"No input file specified."

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

As an experiment I wrote a simple C program that invokes
PHP using system(), but I'm getting an error "No input file

What I do is:

setenv ("REQUEST_METHOD", "GET", 1);
setenv ("QUERY_STRING", "abc=123", 1);

and then I invoke PHP thus:

system "/usr/local/bin/php myfile.php < dummyfile > foo";

where dummyfile is either empty or just contains the line

Yet, I get this error. No finnagling is fix it.

Can anyone explain why this is happening?


Re: "No input file specified."

Bush is a Fascist wrote:

Quoted text here. Click to load it

This usually means that PHP can't find the script.

Quoted text here. Click to load it

Tried using the full path to myfile.php?



Re: "No input file specified."

Yes, I've used the full path and it still fails.

I tried doing the very same thing from the commandline,
and when I set the environment variables as above,
it fails. When I don't set them, my script runs.

Re: "No input file specified."

Quoted text here. Click to load it

In grepping through the source code of PHP 4.4.0, it seems
that the CGI version of PHP insists on having an absolute path
for the name of the script file, so it can set PATH_TRANSLATED
to an appropriate value.

                        Gordon L. Burditt

Site Timeline