Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache2 + PHP + MySQL
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Artem
n00b
n00b


Joined: 09 Mar 2004
Posts: 33

PostPosted: Thu Mar 11, 2004 10:19 pm    Post subject: Apache2 + PHP + MySQL Reply with quote

How would I go about setting this up? Anyone have a guide? I alreade emerged apache, php, mysql, mod_php, etc but it still says PHP is not running, and I bet that it doesn't recognize MySQL either. So how can I make this work?

-Artem
Back to top
View user's profile Send private message
steveb
Advocate
Advocate


Joined: 18 Sep 2002
Posts: 4564

PostPosted: Thu Mar 11, 2004 10:27 pm    Post subject: Reply with quote

if you have apache2 and mod_php installed, then you only need to edit /etc/conf.d/apache2 and enable php in the APACHE2_OPTS, by adding "-D PHP4" to the line:
Code:
APACHE2_OPTS="-D SSL -D PHP4"
and then restart apache2 ;)


cheers

SteveB
Back to top
View user's profile Send private message
Artem
n00b
n00b


Joined: 09 Mar 2004
Posts: 33

PostPosted: Thu Mar 11, 2004 10:28 pm    Post subject: Reply with quote

Tried that, same thing happens :(
Back to top
View user's profile Send private message
steveb
Advocate
Advocate


Joined: 18 Sep 2002
Posts: 4564

PostPosted: Thu Mar 11, 2004 10:30 pm    Post subject: Reply with quote

what is the content of /var/log/apache2/error_log?

cheers

SteveB
Back to top
View user's profile Send private message
fixxxer
n00b
n00b


Joined: 11 Mar 2004
Posts: 3
Location: Moscow, Russia

PostPosted: Thu Mar 11, 2004 10:35 pm    Post subject: Reply with quote

The first thing is that you should not install Apache2+mod_php for production or semi-production purposes:
http://www.php.net/install.apache2

I also prefer to emerge them separately: first Apache then mod_php (mysql should be emerged before php, too). At least this always works fine. :)

You should also study the configure parameters of php and add the corresponding directives to the USE variable or you'll get no modules like DOM, XSLT or GD which are very useful.

If you're going to serve several virtual host you SHOULD read about the base_opendir and safe_mode ini directoves of PHP: this is due to all the php scripts run from the same user and therefore can access each other's sensitive data by default.
Back to top
View user's profile Send private message
Artem
n00b
n00b


Joined: 09 Mar 2004
Posts: 33

PostPosted: Thu Mar 11, 2004 10:39 pm    Post subject: Reply with quote

After emptying the log, restarting the server, and trying to access a PHP page this is what's in the log.
However this does not look like something special =\

Code:
[Wed Mar 10 15:38:43 2004] [notice] Digest: generating secret for digest authentication ...
[Wed Mar 10 15:38:43 2004] [notice] Digest: done
[Wed Mar 10 15:38:44 2004] [notice] Apache/2.0.48 (Gentoo/Linux) configured -- resuming normal operations
[Wed Mar 10 15:38:56 2004] [error] [client XX.XX.XX.XXX] File does not exist: /var/www/localhost/htdocs/favicon.ico

Note: XX.XX.XX.XXX is my blanked out IP address ;)
Back to top
View user's profile Send private message
fixxxer
n00b
n00b


Joined: 11 Mar 2004
Posts: 3
Location: Moscow, Russia

PostPosted: Thu Mar 11, 2004 10:45 pm    Post subject: Reply with quote

This is not an informative part of the log. It's all normal...

Are there mod_php.conf and php.ini files in /etc/apache/conf/addon-modules?
Is mod_php.conf included in httpd.conf or its includes?

What happens if you put an index.php file containing
<?php phpinfo() ?>
to your DocumentRoot and go to http://your_ip/index.php with your browser?
Back to top
View user's profile Send private message
Artem
n00b
n00b


Joined: 09 Mar 2004
Posts: 33

PostPosted: Thu Mar 11, 2004 10:47 pm    Post subject: Reply with quote

OK I see a problem because i don't have an addon-modules folder in conf.
Back to top
View user's profile Send private message
fixxxer
n00b
n00b


Joined: 11 Mar 2004
Posts: 3
Location: Moscow, Russia

PostPosted: Thu Mar 11, 2004 10:55 pm    Post subject: Reply with quote

Hmm.
If you emerged them all-in-time there probably are no addon-modules and everything is in httpd.conf. I just never tried it this way...but i can suppose it is so...
check your conf files for presense of the line like this
LoadModule php4_module /usr/lib/apache/libphp4.so
is it present?
Back to top
View user's profile Send private message
Artem
n00b
n00b


Joined: 09 Mar 2004
Posts: 33

PostPosted: Thu Mar 11, 2004 11:00 pm    Post subject: Reply with quote

Added that - still won't work, even though the file exists... :(
Back to top
View user's profile Send private message
Artem
n00b
n00b


Joined: 09 Mar 2004
Posts: 33

PostPosted: Thu Mar 11, 2004 11:19 pm    Post subject: Reply with quote

Damn, apache is pointless for me if I don't have PHP working :(
Back to top
View user's profile Send private message
radice
n00b
n00b


Joined: 14 Oct 2003
Posts: 27

PostPosted: Fri Mar 12, 2004 9:15 am    Post subject: Reply with quote

I have php4, apache 2.0.48 and mysql 12.22.
To install I followed these steps:

emerge apache
emerge mysql
emerge php
emerge mod_php
Added Line in /etc/apache2/conf/apache2.conf:
LoadModule php4_module modules/libphp4.so
Didn't added the -D PHP in APACHE2_OPTS in /etc/conf.d/apache2

Now it is working perfectly
_________________
"Occupatevi delle cose di Lassù"
Back to top
View user's profile Send private message
meyer37
n00b
n00b


Joined: 04 Feb 2003
Posts: 41
Location: Milwaukee, WI

PostPosted: Sat Mar 13, 2004 8:05 pm    Post subject: Reply with quote

I also had a bit of trouble setting up APACHE2 and PHP. What work for me was
Code:

emerge apache
emerge php
emerge mod_php


I then followed the suggestions at the end of the mod_php emerge and add
Code:
-D PHP4
to the APACHE2_OPTS and also uncommented that line.

The main thing was to uncomment the APACHE2_OPTS line because by default it is commented out. How the simplest errors can sometimes be the hardest to find 8)
Back to top
View user's profile Send private message
webkiller71
n00b
n00b


Joined: 29 Nov 2003
Posts: 20

PostPosted: Sat Mar 13, 2004 8:31 pm    Post subject: Reply with quote

Artem wrote:
[Wed Mar 10 15:38:56 2004] [error] [client XX.XX.XX.XXX] File does not exist: /var/www/localhost/htdocs/favicon.ico


this is irrelevant, this is the icon in the adres bar, if it doesn't exists, it doesn't matter
Back to top
View user's profile Send private message
hermes_jr
l33t
l33t


Joined: 26 Feb 2004
Posts: 701
Location: Moscow, Russia

PostPosted: Sat Mar 13, 2004 10:13 pm    Post subject: Reply with quote

Hmm... icon... DIY!!! (Draw It Youself) :twisted:
And what about this?
Back to top
View user's profile Send private message
mach.82
Tux's lil' helper
Tux's lil' helper


Joined: 30 Oct 2003
Posts: 75
Location: 43°N/79°W

PostPosted: Wed Dec 08, 2004 12:28 am    Post subject: Apache2 + PHP + MySQL Reply with quote

hermes_jr wrote:
Hmm... icon... DIY!!! (Draw It Youself) :twisted:
And what about this?

Hwo do you do that? Or
What tool(s) do I use?
Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum