Hi,
I'm using Apache on a linux machine. I've been trying to install PHP as a CGI interpreter, but I have several problems with it. I think I've configured everything ok, in the httpd.conf file I've added the line:
AddHandler cgi-script .php
and at the top of my .php files I've included the line:
#!/usr/local/bin/php
When I execute the scripts via a web browser, the scripts are executed, but the line #!/usr/local/bin/php is included, even if when I include the line:
<?php echo "Content-type:text/html \r\n\r\n"; ?> after the first line.
After these problems I've tried a different setup: I commented the line
AddHandler cgi-script .php
and added the following lines:
AddType application/x-httpd-php .php
Action application/x-httpd-php /usr/local/bin/php
Now, when I execute a PHP script via my web browser I receive the following error:
The requested URL /usr/local/bin/php/~dj/test.php was not found on this server.
Apache seems to know it has to do something with .php scripts, but it does the wrong thing. I've searched the internet for the past two days for a solution to these problems, but up till now, I didn't find one. Please, please help me 🙂
Sincerely, Ton.