PHP-CGI: Pemature end of script headers
Ruud
Joined: 2002-09-08
Posts: 2 |
Posted: Sun, 2002-09-08 17:07 |
Hosting on a "real" host since a week - and picking up on Perl and PHP since that time. So bare with me please :smile: Gallery's install told me that PHP Safe Mode is enabled. OK, so I'm going for the CGI version. Downloaded CGI PHP. Put it in the CGI-BIN, renamed it, CHMOD-ed it. Made the right dir in my http root. Added .htaccess with the right lines - as I kept getting errors that file is now in my http root, the PHP-CGI folder, and the gallery folder... just to be sure :wink: In each case there is a 500 error. When I check the error log it tells me "Premature end of script headers". I've looked around on the web and it seems this is one of those errors that can be caused by anything, right? Odd thing is that I got this error with some other simple stuff I tried as well. I copy-pasted this upload script (Perl) http://www.webmasterbase.com/article/474/32 and upped it... "Premature end of script headers". I use EditpadPro to edit files like this - just to be sure. But I've succesfully changed stuff in the Perl scripts from Greymatter using Notepad. Anyway.... I'm clueless here :sad: First thing I find that doesn't need me to have root or ask the provider to install stuff and now this again. It should be simple, right? |
|
Posts: 7994
The first thing to do is to make sure that the PHP cgi you installed is properly executable.
Try opening it in your web browser, ie browse to:
http://your.server/path/to/php.cgi
If it's in proper working condition, you'll see a message that starts with:
Security Alert! The PHP CGI cannot be accessed directly...
that means that PHP is working properly. If that doesn't work, you may have the wrong binary or the wrong permissions on the binary. Your ISP may be able to help here.
Posts: 19
I have the same exact problem. I am in the process of trying a different Binary. When I try bharats suggestion by opening the php.cgi, I still get Internal Error.
I'll post back if I get it or not.
Mike
Posts: 7994
Ah, so the internal error is an indicator that something is wrong with your setup or your binary. Check your Apache error log for a clue as to why this is happening. Make sure you check *all* logs (not just the one for your virtual host).