Re: error of "Could not open input file" from PHP CLI

Richard Quadling <[email protected]>
Newsgroups gmane.comp.php.windows
Message-ID <[email protected]>
On 13 October 2010 15:28,  <[email protected]> wrote:
>
> HELP
>
> I have just started to work with PHP.
>
> When I attempt to execute a PHP script I always get the error msg
>       Could not open input file: <file-path-name>
>
> I did not find anything about this being a known problem in the archive
> so presume I am doing something wrong.
>
> How can I resolve this problem?
>
> Howard Holcombe
>
> - - - - - - - - - - - - -
>
> DETAILS
> I downloaded the Windows 5.3.3_VC6 version of PHP onto a XP system and
> did a manual install as per the install.txt file.  The install was
> performed as a regular user rather than Administrator.
>
> 1.
> When I use the PHP CLI program to execute a PHP function from the cmd
> line as in
>        php -r "phpinfo();" > php_results
> I get the expected data in the output file.
>
> 2.
> I created a PHP script file named phpinfo.php (in the directory
> X:\work\hholcomb\PHP\test) using Wordpad to execute the phpinfo()
> function.  The script file permissions are
>          Everyone - Modify, Read&Execute, Read, Write
> The script file is NOT Read-only, Hidden or Archive
>
> 3.
> When I use the PHP CLI program to execute a PHP script file from the cmd
> line as in
>        php -f "X:\work\hholcomb\PHP\test\phpinfo.php"
>
> I get the error
>        Could not open input file: X:\work\hholcomb\PHP\test\phpinfo.php
>
> 4.
> There are no error log entries
>
> 5.
> The changes I made to the php.ini file are
> -----------------------------------
> X:\work\hholcomb\PHP\extract_5.3.3_VC6>diff C:\windows\php.ini
> php.ini-production
> 123d122
> < log_errors = On
> 381d379
> < open_basedir="X:\work\hholcomb\PHP"
> 533c531
> < display_errors = On
> ---
>> display_errors = Off
> 641d638
> < error_log = "X:\work\hholcomb\PHP\error_log\PHP_error_log.log"
> 813d809
> < extension_dir = "X:\work\hholcomb\PHP\extract_5.3.3_VC6\ext"
> 827d822
> < cgi.force_redirect = 0
> 848d842
> < cgi.fix_pathinfo=1
> 857d850
> < fastcgi.impersonate = 1
> 862d854
> < fastcgi.logging = 0
>
> X:\work\hholcomb\PHP\extract_5.3.3_VC6>
> --------------------------------------
>
> I have done the following to isolate/resolve the problem
>   1. validated that the script file does exist in the specified
> directory and is
>         accessible using the DOS "type" command - file contents are
> displayed
>   2. tried using UNIX slashes in the path to the script file - same
> result
>   3. tried running from the directory containing the script file and
> just
>          specifying the name of the file w/o the path - same result
>   4. added a -c <ini-path> to the cmd line - same result
>   5. added/removed the open_basedir specification from the php.ini file
> - same result
>   6. attempted to execute other PHP script files in the same directory
> - same result
>   7. removed the quote characters around the file path for the script
> file - same result
>

Can you load http://live.sysinternals.com/FileMon.exe and filter on
"php.exe" and highlight "phpinfo".

What happens when PHP goes looking for the phpinfo.php script?




-- 
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.