Run PHP as CGI?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt O'Toole

    Run PHP as CGI?

    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.




  • Savut

    #2
    Re: Run PHP as CGI?

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

    Savut

    "Matt O'Toole" <matt@deltanet. com> wrote in message
    news:eRmhc.2764 0$G_.14822@nwrd dc02.gnilink.ne t...[color=blue]
    > 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.
    >
    >
    >
    >[/color]

    Comment

    Working...