By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,827 Members | 1,225 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,827 IT Pros & Developers. It's quick & easy.

Run PHP as CGI?

P: n/a
I'm having trouble getting my PHP scripts to run. My server is configured to
run PHP as CGI w/ suexec. I had PHP going once before, but I lost my files, and
I can't remember what I did the first time. My host is strictly "no support."
Here's all they have to say about PHP in their FAQ:

"How do I use php?
You use it just like any other CGI script. The path to the php binary is
/usr/local/bin/php. It does not run as a module, it runs as a CGI. It runs via
suexec, so don't set group/other write on the script, or it won't run. It also
has to be set executable, and you'll need to print out the "Content-type:"
header (as well as any others you want to use) at the top, just like you would
for a CGI."

Right now I have my .php files in my website's root directory, with permissions
set to owner read/write/execute, group read, others read. I have a path
statement:

#!/usr/local/bin/php

as the first line in each file. What else could I be missing? Do I need to
create a cgi-bin directory, and put my scripts in there? Any ideas?

Matt O.


Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You have to put your php CGI file in a special directory that have execute
permission (eg. cgi-bin).

Savut

"Matt O'Toole" <ma**@deltanet.com> wrote in message
news:eR******************@nwrddc02.gnilink.net...
I'm having trouble getting my PHP scripts to run. My server is configured
to
run PHP as CGI w/ suexec. I had PHP going once before, but I lost my
files, and
I can't remember what I did the first time. My host is strictly "no
support."
Here's all they have to say about PHP in their FAQ:

"How do I use php?
You use it just like any other CGI script. The path to the php binary is
/usr/local/bin/php. It does not run as a module, it runs as a CGI. It runs
via
suexec, so don't set group/other write on the script, or it won't run. It
also
has to be set executable, and you'll need to print out the "Content-type:"
header (as well as any others you want to use) at the top, just like you
would
for a CGI."

Right now I have my .php files in my website's root directory, with
permissions
set to owner read/write/execute, group read, others read. I have a path
statement:

#!/usr/local/bin/php

as the first line in each file. What else could I be missing? Do I need
to
create a cgi-bin directory, and put my scripts in there? Any ideas?

Matt O.


Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.