|corigo||thanks mega and fajita|
|scottie7||hi, I'm having trouble getting PHP working on my RHEL4 system - I keep getting an internal server error.|
PHP works fine from the command line. ie. php script.php
but not from my web browser
/var/log/httpd/error_log says: (8)Exec format error: exec of '/var/www/cgi-bin/AAOSTATS/test.php' failed
Premature end of script headers: test.php
What does "Exec format error" mean?
|dan__t||er... is it a PHP file?|
run 'file' on it, see what it returns
|scottie7||test.php: HTML document text|
dan__t, do I need #!/usr/bin/php?
|jpeg||if you're using php as a cgi, you need that. if you're using mod_php, you don't.|
it looks like you're using cgi, so keep it.
|dan__t||as a cgi, yes|
|jpeg||fajita: premature end of script headers|
|fajita||jpeg: 'Premature end of script headers' means that the script either encountered an error, or is emitting a bogus HTTP header. Check out http://httpd.apache.org/docs/misc/FAQ.html#premature-script-headers or see suexec or see ScriptLog or see 500|
|scottie7||Security Alert! The PHP CGI cannot be accessed directly.|
I'm confused. My PHP parser is outside the web tree ... so why am I getting this error?
D'oh! cos that's how the module was compiled ...
I don't quite understand what I need to do to get around this ...
|david||problem is Fr0zen_, one is afraid jto ask too many questions in the unix community|
people tend to get annoyed quickly
i hear ya
|david||even worse in the linux community|
|Fr0zen_||well do this, install apache from ports|
2.0 "safe" branch
favorite editor here httpd.conf
then take a look at this.