PHP working as CGI with some features

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ivsn@mail.ru

    #1

    PHP working as CGI with some features

    Hi everyone,
    I am trying to got PHP working as CGI with Apache web-server with
    following features:
    1) There are NO "#!/usr/local/bin/php"-headers (or like this) in the
    scripts.
    2) Executable Php-binary is located out of www-tree of apache server.
    I've set in httpd.conf:
    AddType application/x-httpd-php .php
    AddHandler application/x-httpd-php .php
    Action application/x-httpd-php /usr/local/bin/php
    Options [...] ExecCGI # for all /www directory
    and chmod 755 test.php

    And I got in my browser:
    "Not Found
    The requested URL /usr/local/bin/php/usr/local/bin/php/test.php was
    not found on this server."

    If I comment:

    # AddType application/x-httpd-php .php
    AddHandler application/x-httpd-php .php

    or:

    AddType application/x-httpd-php .php
    # AddHandler application/x-httpd-php .php

    then I got:
    "The requested URL /usr/local/bin/php/test.php was not found on this
    server."
    ----
    Version of PHP is 4.3.3. It compiled with options:
    './configure' '--enable-force-cgi-redirect' '--enable-discard-path'
    '--enable-memory-limit' '--with-config-file-path=/usr/local/etc'
    '--with-mysql' '--enable-calendar' '--enable-bcmath'
    '--with-ming=/usr/lib'
    and working cli mode fine.
  • Duane L

    #2
    Re: PHP working as CGI with some features

    Try putting your php script in
    /var/www/cgi-bin where apache expects to find cgi.
    I recently was presented with this same problem when I put up
    a section of our website:

    http://www.promopeddler.com/Promotio...eb-Content.htm

    Essentially you call it just like a regular cgi file,


    Also, I eventually figured out I had to use "<?php" as the opening tag,
    just "<?" didn't work even though I had short tags enabled.
    ..
    ivsn@mail.ru wrote in message news:<657eb9e2. 0309100557.8592 413@posting.goo gle.com>...[color=blue]
    > Hi everyone,
    > I am trying to got PHP working as CGI with Apache web-server with
    > following features:
    > 1) There are NO "#!/usr/local/bin/php"-headers (or like this) in the
    > scripts.
    > 2) Executable Php-binary is located out of www-tree of apache server.
    > I've set in httpd.conf:
    > AddType application/x-httpd-php .php
    > AddHandler application/x-httpd-php .php
    > Action application/x-httpd-php /usr/local/bin/php
    > Options [...] ExecCGI # for all /www directory
    > and chmod 755 test.php
    >
    > And I got in my browser:
    > "Not Found
    > The requested URL /usr/local/bin/php/usr/local/bin/php/test.php was
    > not found on this server."
    >
    > If I comment:
    >
    > # AddType application/x-httpd-php .php
    > AddHandler application/x-httpd-php .php
    >
    > or:
    >
    > AddType application/x-httpd-php .php
    > # AddHandler application/x-httpd-php .php
    >
    > then I got:
    > "The requested URL /usr/local/bin/php/test.php was not found on this
    > server."
    > ----
    > Version of PHP is 4.3.3. It compiled with options:
    > './configure' '--enable-force-cgi-redirect' '--enable-discard-path'
    > '--enable-memory-limit' '--with-config-file-path=/usr/local/etc'
    > '--with-mysql' '--enable-calendar' '--enable-bcmath'
    > '--with-ming=/usr/lib'
    > and working cli mode fine.[/color]

    Comment

    Working...