Koozali.org: home of the SME Server

Unable to get php scripts to work.

Brian Jacobsen

Unable to get php scripts to work.
« on: December 12, 2001, 12:44:08 AM »
Hi,

This is probably some simple error, but I cannot get my php scripts to work.

I have this ibay 'billeder' with dynamic content enabled

I have created an index.html that calls a php script in cgi-bin, but I get an internal server error:

The script and the cgi-bin directory has been chmod to 755, the script is a small sample script, that should work:

When I look at the error_log it says:

[Mon Dec 10 22:17:25 2001] [error] (8)Exec format error: exec of /home/e-smith/files/ibays/billeder/cgi-bin/spis.php3 failed
[Mon Dec 10 22:17:25 2001] [error] [client xx.xxx.xxx.xxx] Premature end of script headers: /home/e-smith/files/ibays/billeder/cgi-bin/spis.php3

I tried to imbed some php in a html in the html directory file like this:

PHP Test

"; ?>


 and this does not work either. No errors in error.log, it just does not display anything.

Any ideas?

Kind regards
Brian

Dan Brown

Re: Unable to get php scripts to work.
« Reply #1 on: December 12, 2001, 01:10:29 AM »
PHP will not process .html files--if you want to embed PHP code, call the file index.php instead.

Garret

Re: Unable to get php scripts to work.
« Reply #2 on: December 13, 2001, 02:57:09 AM »
also, why are you placing it in the cgi bin?Brian Jacobsen wrote:

Rob Hillis

Re: Unable to get php scripts to work.
« Reply #3 on: December 13, 2001, 03:07:53 AM »
Brian Jacobsen wrote:
> This is probably some simple error, but I cannot get my php
> scripts to work.
> I have this ibay 'billeder' with dynamic content enabled
> I have created an index.html that calls a php script in
> cgi-bin, but I get an internal server error:

Don't put PHP scripts in the cgi-bin directory.  Remove *all* index.htm/html files from the html directory and call your PHP script index.php.  Apache will pick it up fine.

Remember, any file with PHP embedded in it needs to have the extension .php in order for it to be picked up and processed properly.