View previous topic :: View next topic |
Author |
Message |
nconantj n00b
Joined: 28 Jun 2004 Posts: 13
|
Posted: Mon Jul 05, 2004 8:29 pm Post subject: PHP Pages not served up with Apache 2 [SOLVED] |
|
|
I'm stumped here...
I've installed Apache 2 with mod_php. When I run apache with PHP disabled, my php pages are served up as plain text, as expected. BUT, when I enable PHP with Code: | APACHE2_OPTS="-D PHP4" | , my php pages aren't served up, in fact nothing at all happens unless I try to access a non-php URL on my system (i.e. try for a directory listing, access a file directly or access a URL with the index as index.html).
All the permissions are set correcty, the syntax is correct, and, except for the required modification to /etc/conf.d/apache2, all the configuration files are untouched.
Please help me if you can... I'd rather not have to unmerge PHP, apache, and mod_php, which I'd do if I went to install manually. Apache and PHP were installed manually under Redhat, and work fine.
Last edited by nconantj on Tue Jul 06, 2004 9:57 am; edited 1 time in total |
|
Back to top |
|
|
nobspangle Veteran
Joined: 23 Mar 2004 Posts: 1318 Location: Manchester, UK
|
Posted: Mon Jul 05, 2004 9:07 pm Post subject: |
|
|
what do you get in the access_log |
|
Back to top |
|
|
nconantj n00b
Joined: 28 Jun 2004 Posts: 13
|
Posted: Mon Jul 05, 2004 9:34 pm Post subject: |
|
|
Logs with "-D PHP4"
access_log:
Code: | 127.0.0.1 - - [05/Jul/2004:17:14:15 -0400] "GET /~test2 HTTP/1.1" 301 376 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
127.0.0.1 - - [05/Jul/2004:17:14:27 -0400] "GET /~test HTTP/1.1" 301 375 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
192.168.100.102 - - [05/Jul/2004:17:21:07 -0400] "GET /~test2 HTTP/1.1" 301 376 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
192.168.100.102 - - [05/Jul/2004:17:25:02 -0400] "GET /~test HTTP/1.1" 301
375 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
192.168.100.102 - - [05/Jul/2004:17:25:02 -0400] "GET /~test/ HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
192.168.100.102 - - [05/Jul/2004:17:25:15 -0400] "GET /~test2 HTTP/1.1" 301 376 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
192.168.100.102 - - [05/Jul/2004:17:25:57 -0400] "GET /~test2/index.html.old HTTP/1.1" 200 72 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
|
error_log:
Code: | [Mon Jul 05 17:14:07 2004] [notice] Digest: generating secret for digest authentication ...
[Mon Jul 05 17:14:07 2004] [notice] Digest: done
[Mon Jul 05 17:14:08 2004] [notice] Apache/2.0.49 (Gentoo/Linux) mod_ssl/2.0.49 OpenSSL/0.9.7d Hardened-PHP/4.3.7 configured -- resuming normal operations
[Mon Jul 05 17:14:15 2004] [error] [client 192.168.100.102] Negotiation: discovered file(s) matching request: /home/test2/public_html/index.html (None could be negotiated).
[Mon Jul 05 17:15:13 2004] [notice] caught SIGTERM, shutting down
[Mon Jul 05 17:21:03 2004] [notice] Digest: generating secret for digest authentication ...
[Mon Jul 05 17:21:03 2004] [notice] Digest: done
[Mon Jul 05 17:21:04 2004] [notice] Apache/2.0.49 (Gentoo/Linux) mod_ssl/2.0.49 OpenSSL/0.9.7d Hardened-PHP/4.3.7 configured -- resuming normal operations
[Mon Jul 05 17:21:07 2004] [error] [client 192.168.100.102] Negotiation: discovered file(s) matching request: /home/test2/public_html/index.html (None could be negotiated).
[Mon Jul 05 17:21:07 2004] [error] [client 192.168.100.102] Negotiation: discovered file(s) matching request: /home/test2/public_html/index.html (None could be negotiated).
[Mon Jul 05 17:25:15 2004] [error] [client 192.168.100.102] Negotiation: discovered file(s) matching request: /home/test2/public_html/index.html (None could be negotiated).
[Mon Jul 05 17:25:15 2004] [error] [client 192.168.100.102] Negotiation: discovered file(s) matching request: /home/test2/public_html/index.html (None could be negotiated).
|
Clearly Apache is trying to get index.html and not finding it, but commonapache2.conf contains the DirectoryIndex. When I try directly accessing a php file (~test2/test.php), the access log does not reflect this.
Logs without "-D PHP4"
access_log:
Code: | 127.0.0.1 - - [05/Jul/2004:17:30:20 -0400] "GET / HTTP/1.1" 304 - "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
127.0.0.1 - - [05/Jul/2004:17:30:20 -0400] "GET /apache_pb.gif HTTP/1.1" 304 - "http://localhost/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
127.0.0.1 - - [05/Jul/2004:17:30:25 -0400] "GET /~test2 HTTP/1.1" 301 327 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
192.168.100.102 - - [05/Jul/2004:17:30:25 -0400] "GET /~test2/ HTTP/1.1" 200 16 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
192.168.100.102 - - [05/Jul/2004:17:30:30 -0400] "GET /~test2/test.php HTTP/1.1" 200 16 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
192.168.100.102 - - [05/Jul/2004:17:30:35 -0400] "GET /~test HTTP/1.1" 301
326 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040626 Epiphany/1.2.2"
|
error_log:
Code: | [Mon Jul 05 17:30:14 2004] [notice] Digest: generating secret for digest authentication ...
[Mon Jul 05 17:30:14 2004] [notice] Digest: done
[Mon Jul 05 17:30:15 2004] [notice] Apache/2.0.49 (Gentoo/Linux) configured -- resuming normal operations
[Mon Jul 05 17:30:25 2004] [error] [client 192.168.100.102] Negotiation: discovered file(s) matching request: /home/test2/public_html/index.html (None could be negotiated). |
|
|
Back to top |
|
|
RedDawn Guru
Joined: 22 Sep 2003 Posts: 368 Location: Los Angeles, California
|
Posted: Mon Jul 05, 2004 11:31 pm Post subject: Re: PHP Pages not served up with Apache 2 |
|
|
Code: | APACHE2_OPTS="-D PHP4" |
why do people start apache like that.. why dont you just load the php module..
php4_module extramodules/libphp4.so
what the difference.. alli have to do i that. and my php works... |
|
Back to top |
|
|
nconantj n00b
Joined: 28 Jun 2004 Posts: 13
|
Posted: Tue Jul 06, 2004 12:55 am Post subject: |
|
|
Simply Loading the module just doesn't work here.
Here's some version info:
Code: |
Apache - 2.0.49-r4
mod_php - 4.3.7-r1
|
These are the defaults for the portage tree as of 3:00 AM US EDT. (I have cron run emerge sync every night at 3:00 AM). |
|
Back to top |
|
|
nconantj n00b
Joined: 28 Jun 2004 Posts: 13
|
Posted: Tue Jul 06, 2004 9:57 am Post subject: |
|
|
SOLVED: I recompiled PHP and mod_php with '-hardenedphp' in my USE flags. |
|
Back to top |
|
|
|