| Summary: | After installing mod_php and updating /etc/conf.d/apache2, .php files are not parsed by PHP | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Bryan Helmkamp <helmkam1> |
| Component: | [OLD] Server | Assignee: | PHP Bugs <php-bugs> |
| Status: | RESOLVED INVALID | ||
| Severity: | major | CC: | mario_vazq, storri, twoengineers |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
My apache2.conf
My commonapache2.conf Output of http://localhost/server-info Output of http://localhost/server-status Output of /usr/sbin/apache2 -k start -D PHP4 -X -e Debug My /etc/apache2/conf/ directory Latest server-info Latest server-status Latest debugging output |
||
|
Description
Bryan Helmkamp
2004-04-29 13:49:22 UTC
works fine for me. I had the same problem; i think APACHE2_OPTS simply gets ignored because 'sudo apache2 -k start -D PHP4' fires up an apache daemon that does parse php scripts. please include the output from 'ps -ef |grep apache2' you say you edited /etc/conf.d/apache2 and added the APACHE2_OPTS="-D PHP4" line to the top, did you comment out the other line with APACHE2_OPTS or leave it in ? how did you restart apache? /etc/init.d/apache2 restart ? I replaced the existing APACHE2_OPTS line (that has -D SSL on it) with APACHE2_OPTS="-D PHP4". I've also tried leaving "-D SSL" in the options, but that doesn't fix the problem. Yes, I am using /etc/init.d/apache2 to start, stop, and restart Apache. Ouput from ps -ef |grep apache2: root 26045 1 0 01:52 ? 00:00:00 /usr/sbin/apache2 -k start -D PHP4 root 26052 24753 0 01:52 pts/11 00:00:00 grep apache2 please enable /server-info and /server-status in the apache2 config, and attach the output from http://host/{server-info,server-status} here. please also attach your apache2.conf and commonapache2.conf here. Created attachment 30667 [details]
My apache2.conf
Created attachment 30668 [details]
My commonapache2.conf
Created attachment 30669 [details] Output of http://localhost/server-info Created attachment 30670 [details] Output of http://localhost/server-status hmm, strange. please run: '/etc/init.d/apache2 stop' '/usr/sbin/apache2 -t -D PHP4 ; echo $?' - see if there is any output from this (if the output isn't just a '0', then please include it here). '/usr/sbin/apache2 -k start -D PHP4' - again, i'm interested in any output if neigther of the above two give any output try '/usr/sbin/apache2 -k start -D PHP4 -X -e Debug' - and attach the full output after checking it for private information. Result of executing the first two commands: # /usr/sbin/apache2 -t -D PHP4 ; echo $? Syntax OK 0 # /usr/sbin/apache2 -k start -D PHP4 prints no output Created attachment 30720 [details]
Output of /usr/sbin/apache2 -k start -D PHP4 -X -e Debug
Any progress on this? I still cannot get this to work. The problem is not apache, is php installation. Already was submited as bug #50991 http://bugs.gentoo.org/show_bug.cgi?id=50991 To fix the problem edit the /etc/php/apache2-php4/php.ini file and change this: ;include_path = ".:/php/includes" into this: include_path = "/usr/lib/php" Also the /etc/php/cli-php4/php.ini have the same include_path entry as the file above, so probably it should be modified also.. i've fixed the include_path issue now. Bryan: emerge sync ; emerge -u mod_php php ; and see if the issue is fixed for you. Robin and Mario: Sorry, no go. My include_path line in all of my php.ini files now reads: include_path = ".:/usr/lib/php" But Apache is still not parsing any .php files. The include_path issue seems unrelated because Apache is not sending my .php files to PHP to be parsed. Any other ideas? brian: could you tar up your entire /etc/apache2/conf directory and attach it here, along with new versions of your server-info and server-status. also, could you start up a single threaded debug instance of httpd with php enabled, and see what happens when you hit a php page? (attach the log, it will probably be quite large). Created attachment 32690 [details]
My /etc/apache2/conf/ directory
Created attachment 32691 [details]
Latest server-info
Created attachment 32692 [details]
Latest server-status
Robin, What command do I need to run to get the debug output you want? 'strace -ff /usr/sbin/apache2 -k start -D PHP4 -X -e Debug 2>&1 | tee logfile' then a call up a single php page with your browser. it should generate a LOT of stuff into logfile. Created attachment 32758 [details]
Latest debugging output
Result of "strace -ff /usr/sbin/apache2 -k start -D PHP4 -X -e Debug 2>&1 | tee
logfile"
Your trace command says your php file looks like this: <php phpinfo(); ?> While it should read: <?php phpinfo(); ?> Note the ? in <?php well done to Dave Liefbroer for spotting why your code was borked. if this is still an issue once that is fixed, please reopen. |