PDA

View Full Version : PHP on Apache Problem


Jaws
15th July 2004, 05:26 AM
Hey all. Running Fedora Core 2 here, using Apache.

When I try to run a .php file on my server, i get 500 Internal Server Error.

This is what turns up in my error logs:

[Tue Jul 13 23:15:03 2004] [error] [client 192.168.1.100] attempt to invoke directory as script: /var/www/cgi-bin/
[Tue Jul 13 23:15:08 2004] [error] [client 192.168.1.100] (8)Exec format error: exec of '/var/www/cgi-bin/index.php' failed
[Tue Jul 13 23:15:08 2004] [error] [client 192.168.1.100] Premature end of script headers: index.php

I have CHMODDED the file index.php with all permissions, and still getting this error.

I have this in my httpd.conf file:
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
ScriptAlias /cgi-bin/ "/usr/bin/"
AddType application/x-httpd.php .php
Action application/x-httpd.php "/php"


#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>


If you have any solutions to this problem it is GREATLY appreciated. :)

ewdi
15th July 2004, 05:33 AM
change the files owner to apache

Jaws
15th July 2004, 06:05 AM

change the files owner to apache

Nope, that didnt solve it. :(

Same error as before; and this still shows in the error log:

[Wed Jul 14 00:00:10 2004] [error] [client 192.168.1.100] (8)Exec format error: exec of '/var/www/cgi-bin/index.php' failed
[Wed Jul 14 00:00:10 2004] [error] [client 192.168.1.100] Premature end of script headers: index.php

Jaws
15th July 2004, 07:39 AM
Aha, damn problem, I got it !

Got it fixed. I had to load the php4 module file and then execute the file outside of the /cgi-bin/ folder. :)

^_^

Jaws
16th July 2004, 04:59 AM
Well, with that problem being fixed, another has come forth. :(

PHP doesn't report any errors for some odd reason...can anyone help me with this issue? Thanks alot.