I'm trying to use php on the command line like I do perl. It works fine and from the command line. BUt trying to run a cgi script from the browser always give a "No input file specified." CGI using perl works fine.

I have a test1.cgi written in perl and a test2.cgi written in php. both simply output

Content-type: text/html
test

The perl one works from the web browser, the php one gives the no input file specified error.

PHP 4.0.5
Apache 1.3.20
Linux 2.2.18

Any idea?

    3 months later

    Hi,

    Did you ever get this issue resolved?

    Thanks,
    Ken

      I forget what I did but I did get it fixed. I think after I compiled in PHP as a module I removed the entire php source tree and re-extracted the php.tar.gz and built the cgi binary from a fresh source tree. For some reason that helped. Thats all I can remember.

        3 months later

        We experienced the problem you mentioned and spent hours fixing the problem.

        What you have to do is add the line :-

        Action application/x-httpd-php3 /path/to/php

        underneath the part in the php.ini where it says:-
        AddType application/x-httpd-php3 .php3
        AddType application/x-httpd-php3-source .phps

        /path/to/php - is where the command line php program is stored.

        Reboot apache and then everything should work.

        Jason.

          Write a Reply...