"No input file specified."

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bush is a Fascist

    "No input file specified."


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

    What I do is:

    setenv ("REQUEST_METHO D", "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
    "abc=123".

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

    Can anyone explain why this is happening?

    Thanks,
    333

  • Colin McKinnon

    #2
    Re: &quot;No input file specified.&quot ;

    Bush is a Fascist wrote:
    [color=blue]
    >
    > As an experiment I wrote a simple C program that invokes
    > PHP using system(), but I'm getting an error "No input file
    > specified.".
    >[/color]

    This usually means that PHP can't find the script.
    [color=blue]
    >
    > system "/usr/local/bin/php myfile.php < dummyfile > foo";
    >[/color]

    Tried using the full path to myfile.php?

    HTH

    C.

    Comment

    • Gordon Burditt

      #3
      Re: &quot;No input file specified.&quot ;

      >As an experiment I wrote a simple C program that invokes[color=blue]
      >PHP using system(), but I'm getting an error "No input file
      >specified.".
      >
      >What I do is:
      >
      >setenv ("REQUEST_METHO D", "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
      >"abc=123".
      >
      >Yet, I get this error. No finnagling is fix it.[/color]

      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

      Comment

      • Bush is a Fascist

        #4
        Re: &quot;No input file specified.&quot ;

        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.

        Comment

        Working...