# Php5 + Apache22



## Anonymous (Dec 29, 2009)

I've install php5 from ports and followed the installation instructions in http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-apache.html and am now trying to run /cgi-bin/test.php which just contains the most basic php script. I keep getting an internal server error though. Attached is my httpd.conf.


----------



## DutchDaemon (Dec 29, 2009)

What does the error-log have to say about it?


----------



## Anonymous (Dec 29, 2009)

the error-log is telling me "premature end of script headers"


#!/usr/local/bin/python

print "Content-Type: text/html\n\n"
print "<h1>Hello world</h1>"



am I missing something?


----------



## SirDice (Dec 29, 2009)

CGI != php. Yes, you can make CGI scripts with php but that's not how it's supposed to work.

Drop this in your webroot, named index.php:

```
<?php
phpinfo();
?>
```


----------



## Anonymous (Dec 29, 2009)

I figured it out. I was using python to execute the script and was indenting the print statements when I wasn't supposed to.


----------

