[plug] Apache/PHP problem driving me NUTS
Craig Ringer
craig at postnewspapers.com.au
Mon Mar 24 14:08:04 WST 2003
Hi all
I've been battling Apache + PHP4 for a while here, so I thought I'd ask
a quick question here to see if anybody can figure out what's going on.
Google hasn't helped me - well, unless I'm asking the wrong question....
I have a machine here with a normal default content set, and a virtual
host providing different content to anybody accessing the server by its
outside-world name/IP.
I have a PHP script, upload.php, that just won't run correctly when
served by the virtual host from its documentroot, but runs fine from the
non-vhosted server. Two other PHP scripts that use the same database,
etc, run fine both vhosted and not.
The script uses all the same modules as the other two, and what's more
it runs fine from php4 in CGI mode on the command line. *arrggh*.
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.
There isn't even a request logged in access_log (where there normally is
for the other scripts).
There is no information in syslog about the problem, either.
In summary, I have one script that fails only when run by apache in
vhost mode. It works when not vhosted, it works when run with CGI-mode
php4, and two other scripts using much the same things work in all of
these cases. Something weird is going on, and I'm really confused. Help?!?
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>
so .... help?!?
More information about the plug
mailing list