Page 1 of 1
newbie with php server error
Posted: Tue Aug 02, 2005 7:28 pm
by nephish
Hey there, trying to learn php. sorry for the newbie-ness of this one, but i have a ver simple php script that i cannot get past premature ending of script headers in
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>test</title>
</head>
<body>
<?php
// Hello World in PHP
echo 'Hello World!';
?>
</body>
</html>
i have tried from the web_root and from cgi-bin , which i really believe to be set up correctly because i have python cgi scripts that work.
just cannot get the php stuff to go. i use debian linux. and i have phpmyadmin installed and it seems to be working fine.
i just dont get it.
what am i doing wrong?
thanks.
Posted: Tue Aug 02, 2005 7:34 pm
by shiznatix
looks just fine to me. what does it output exactally?
Posted: Tue Aug 02, 2005 7:50 pm
by nephish
from the browser
Code: Select all
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, nephish@xit.net and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
from the error_log
Code: Select all
[Tue Aug 2 19:55:22 2005] [error] (8)Exec format error: exec of /var/www/me/cgi-bin/testphp.php failed
[Tue Aug 2 19:55:22 2005] [error] [client 63.97.188.161] Premature end of script headers: /var/www/me/cgi-bin/testphp.php
thanks
Posted: Tue Aug 02, 2005 7:56 pm
by feyd
looks like they have a malformed auto-append or auto-prepend setting.. talk to your host..
Posted: Tue Aug 02, 2005 7:58 pm
by hansteam
looks like one of two possible problems to me. 1) your server's PHP support is down 2) you need to move your script. If you have a directory "/var/www/me/httpdocs/" try putting it in there.
Posted: Tue Aug 02, 2005 7:58 pm
by nephish
um..... i am the host.
i am already host a couple of sites that use python in the cgi, but php seems to be not working (except for phpmyadmin)
maybe my server is set up wrong.
thanks
Posted: Tue Aug 02, 2005 8:35 pm
by nephish
oh, ok. its fixed now.
i had to set up another ScriptAlias in the http.conf so the thing would run from the new cgi-bin that i created .
cool.
thanks for your time, gents
Posted: Wed Aug 03, 2005 1:17 am
by bokehman
php scripts should run from root and not need to be in the CGI bin. You must have miss configured it.
Posted: Wed Aug 03, 2005 1:32 am
by feyd
php can be run as a CGI...

Posted: Wed Aug 03, 2005 1:43 am
by bokehman
feyd wrote:php can be run as a CGI...

Yes but it is certainly not the prefered setup.