Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble installing PHP... 2

Status
Not open for further replies.

Krel

Programmer
Feb 3, 2002
135
CA
OK, I'm attempting to install PHP. I wrote a sample PHP CGI script, which is located at
You can go there and see the error message I get. As per the instructions, I looked at the manual but couldn't find anything about an Apache Action Directive. Does anyone know the line I should add to httpd.conf (or php.ini?) to bypass this warning?

I'm using Apache version 2.something-or-other, and PHP 4.
 
what was the content of your script - post the code.
Also you may need to check out your apache documentation and also that of php.

code first, other stuff after. ***************************************
Party on, dudes!
[cannon]
 
looking at other stuff , seems you need to look at the permissions you set in apache for each file or folder.

Apache tries to execute your php script but is not allowed therefore it fails. ***************************************
Party on, dudes!
[cannon]
 
The entirety of my code is this (it's just a test script):

Code:
#!/php/php

<?php
phpinfo() 
?>

I'm not sure that permissions are the problem. I have &quot;ExecCGI&quot; as an option under my root directory, and perl scripts work fine, so I can't see how permissions would be the problem. I also have added the following lines to httpd.conf. Is there any others I would need to add?

Code:
AddType application/x-httpd-php .php
Action application/x-httpd-php &quot;/php/php.exe&quot;
AddHandler cgi-script .cgi .pl [COLOR=red].php[/color]
 
not sure about apache under windoze whether you actually need the AddHandler cgi-script .cgi .pl .php
also you missed the ; after phpinfo(); ***************************************
Party on, dudes!
[cannon]
 
Eh, I was under the impression that php was like perl and that a demicolon was optional as the last statement in a block. I haven't quite begun to learn php yet. ;)

My CGI scripts don't work without Add-handler, so i better leave that in. I'm sure it wouldn't hurt.

So, any other ideas?
 
the semi colon is compulsory, the cgi bit referring to php remove, but keep the rest for cgi.

AddHandler cgi-script .cgi .pl

try then your php page. ***************************************
Party on, dudes!
[cannon]
 
Hi mate,

Remove the .php from the Addhandler directive.

AddHandler cgi-script .cgi .pl

Then change the PHP directive to the following..

ScriptAlias /php/ &quot;c:/php/&quot;
AddType application/x-httpd-php .php
Action application/x-httpd-php &quot;/php/php.exe&quot;

It should now work.. Hopefully.. [wink]

Hope this helps Wullie

 
Removing the .php from the AddHandler directive worked! Thanks, guys!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top