Forum Moderators: coopster
<html>
<head>
<title>Today's Date</title>
</head>
<body>
<p>Today's Date (according to this Web server) is
<?php
echo( date("l, F dS Y.") );
?>
</p>
</body>
</html>
I have saved with a .php extension, uploaded in ASCII and chmod to 755 but get a 500 error. This is on Apache/1.3.27.
According to my web host:
"$HOSTING_COMPANY currently has PHP 4.06 installed on all its Linux/UNIX servers. This version also runs PHP3. PHP is only available with the $BigNumber Plan or higher. The file needs to have the following:
Files need to have a .php or .php3 extension
Files need to be uploaded in ASCII
Files need to have 755 permissions, and the path to PHP at the top of the file. The path to PHP is #!/usr/local/bin/php
Please note that on $HOSTING_COMPANY dedicated servers, PHP is installed as a module and is compiled as a cgi instead of a module."
I have tried putting the path above the <HTML> tag, but get an invalid markup warning.
Do I have to make a separate script, save it in cgi-bin, and somehow call it from the HTML page?
Is the fact that is "installed as a module and compiled as cgi" make any difference, athough now that I think of it we are not on a dedicated server, but virtual.
BTW, their tech support is so slow, that is why the post here.
I've been to php.org and dozens of tutorial sites, but there is no mention of having to include the path to PHP in the places I've browsed.
Any tips on where to look, links, etc.?
Thanks in advance,
Laurence Martin
[Thu Feb 20 14:10:16 2003] [error] [client 67.x.x.x] Premature end of script headers: /home/xxx/xxx/untitled.php
failed to open log file
fopen: Permission denied
[Thu Feb 20 14:33:38 2003] [error] [client 67.x.x.x] Premature end of script headers: /home/xxx/xxx/untitled.php
[Thu Feb 20 16:43:57 2003] [error] [client 67.x.x.x] Premature end of script headers: /home/xxx/xxx/phpinfo.php
failed to open log file
fopen: Permission denied
[Thu Feb 20 16:46:26 2003] [error] [client 67.x.x.x] Premature end of script headers: /home/xxx/xxx/phpinfo.php
failed to open log file
fopen: Permission denied
[Thu Feb 20 17:02:50 2003] [error] [client 67.x.x.x] Premature end of script headers: /home/xxx/xxx/untitled.php
Thanks
I swear I tried this! Honest!
But it works now.
<snip>
Here is the code in case anyone is interested:
#!/usr/local/bin/php
<html>
<head>
<title>Today's Date</title>
</head>
<body>
<p>Today's Date (according to this Web server) is
<?php
echo( date("l, F dS Y.") );
?>
</p>
</body>
</html>
It may be that this "problem" is unique to my web host.
More likely it is my ignorance.
I am moving on to learn more! Many thanks.
-Laurence Martin
[edited by: jatar_k at 3:11 am (utc) on Feb. 21, 2003]
Could anybody explain that? How can PHP [php.net] be installed as a module when it is compiled as a CGI binary? If it is installed as a module the webserver will need load a dynamic library containing the PHP [php.net] engine. If it is installed as a binary then it will be called via the CGI and will need a correct shebang to tell the kernel which interpreter to use.
Andreas