[plug] Apache/PHP problem driving me NUTS

James Devenish devenish at guild.uwa.edu.au
Mon Mar 24 14:20:33 WST 2003


In message <3E7EA0C4.2040308 at postnewspapers.com.au>
on Mon, Mar 24, 2003 at 02:08:04PM +0800, Craig Ringer wrote:
> I've been battling Apache + PHP4 for a while here,

Perhaps for different reasons, PHP4 is a regular battle for me.
If nothing else, we can cry on each other's shoulders.

> When the PHP script fails to run, no errors appear in the apache logs - 
> either the vhost specific ones, or the main logs. The script is dumped 
> to the browser in original PHP code form, rather than being executed. 

Are you able to trim back the PHP code until it works?

I wonder if you can try forcing the content type, just to see whether
Apache is at least awake. E.g.:

<FilesMatch "upload.php">
ForceType "text/html"
</FilesMatch>

or

<FilesMatch "upload.php">
ForceType "application/x-httpd-php"
</FilesMatch>

and ensure that PHP is being used. Okay, there's apparently NO reason
why that would be the case, but perhaps this check would come in handy
at some other time.

> There isn't even a request logged in access_log (where there normally is 
> for the other scripts).

Is an Apache worker crashing? Are you getting core dumps. (I have no
idea how to get Linux to put Apache dumps into a useful directory with
timestamps so that you can find them.)

> Here are some httpd.conf snippets:
> 
> LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
> .....
> AddType application/x-httpd-php .php
> AddType application/x-httpd-php-source .phps
> .....
> <VirtualHost worldreachablename:80>
>         DocumentRoot /var/www/access_root/
>         NameVirtualHost 203.59.125.43:80
>         <Directory /var/www/access_root>
>                 order allow,deny
>                 allow from all
>                 Options Indexes FollowSymLinks
>         </Directory>
>         ScriptAlias /cgi-bin/ /var/www/access_cgi/
>         ErrorLog /var/log/apache/access_error_log
>         CustomLog /var/log/apache/access_custom_log common
>         LogLevel Debug
>         php_value error_log syslog
>         php_flag error_reporting on
>         php_flag log_errors on
> </VirtualHost>




More information about the plug mailing list