Re: php-cli
| From: | Dmitry Ruban | Date: | Mon, 15 Mar 2010 00:32:24 +0000 |
| Subject: | Re: php-cli | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-302818@lists.php.net to get a copy of this message | ||
Rick Pasotto wrote:
On Sun, Mar 14, 2010 at 08:40:51PM +0000, Ashley Sheridan wrote:On *nix, you can add "#!/usr/bin/php" as first line and make file executable (chmod +x). -- DmitryOn Sun, 2010-03-14 at 16:41 -0400, Rick Pasotto wrote:Of course not. php scripts are not executable. If I had tried to execute it directly the shell would have told me that. If I had then set the executable bit the shell would have tried to execute the contents of the file and the shell would have given several error messages. I repeat: is there more than one way to run a php script from the cli?On Sun, Mar 14, 2010 at 06:13:24PM +0000, Ashley Sheridan wrote:Well you havn't given an example, and just say you're calling the script from command line and it's outputting the script there. Are you maybe just calling the php file without calling php first?On Sun, 2010-03-14 at 14:15 -0400, Rick Pasotto wrote:Is there more than one way? I suppose with and without the -f could count as two ways, but the man page says without defaults to with so they're really the same.Has cli php changed recently? I've got a php script (script1) that creates a php script (script2) by opening a file and then writing to it. When I try to run it from the command line script1 is simply copied to stdout. When I run it from the browser it works as expected. The directory has 777 permissions so that should not be the problem. Any ideas?How are you running it from the command line?