My school's web server is not setup to handle PHP pages. I was told that I need to wrap them in a CGI script. I have never used CGI so I am not sure what I am doing wrong. I followed all of there instructions as far as I can tell and I still have a script error. Below is the code that I am trying to use:
#!/usr/local/bin/php
Content-Type: text/http
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
print "test";
?>
</html>
If you have any idea what I am doing wrong, I would greatly appreciate the help.
Thanks,
-Cam
PHP wrapped in CGI
Moderator: General Moderators
make sure the path to the php executable is correct... the following command may help you:
user@host: which php
if you are going for php and cli, i remember from the old perl days you need to output twice \r\n after the content type....
#!/usr/local/bin/php
<?php
echo "Content-Type: text/html \r\n\r\n";
?>
hehe
should be enough to get you started...
user@host: which php
if you are going for php and cli, i remember from the old perl days you need to output twice \r\n after the content type....
#!/usr/local/bin/php
<?php
echo "Content-Type: text/html \r\n\r\n";
?>
hehe
should be enough to get you started...