I run the CLI of php and put the file name as an arguement. It then responds "Could not read input file." I have been trying at this for quite a while I would appreciate any help.
PHP won't open .php files
cerin:
What is "the CLI"?
It would help if you would state what operating system you are using?
What server you are using (Apache/IIS) ?
What version of PHP are you using?
The more information you give the more likely someone will try and help you.
I was using PHP 5.1.2. I had Apache 2. I am currently using Windows XP(dual boot with linux). The CLI is the CLI named "php" that is in the "PHP" folder after you extract it.
Instead of dealing with it any longer I just got an all-in-one installation that works.
One possibility is that open_basedir is enabled in your master php.ini, but you're trying to run a script outside of the open_basedir.
open_basedir applies to the main PHP file as well as any files it opens, includes etc.
Mark
You can get datas from file with file_get_contents or file function.
You realise that in order to run cli scripts on linux thay need to begin with a shebang pointing to the cli binary? eg;
#!/usr/bin/php
<?php
echo "hello";
?>
You posted this in the windows help, does that mean we can ignore the linux half of your dual boot and your problem is trying to run php from the command line in windows?
If so, windows doesn't need or use the #!<shebang> thingy.
Is "cannot read input file" the exact error message? A message like that hints that the input file is corrupted or you have a file permissions issue where your user account, or the file, or php.exe has incorrect access permission settings.
If you're asking about php in linux, well, nevermind