note 50697 added to features.commandline
| From: | bertrand at toggg dot com | Date: | Mon, 07 Mar 2005 16:40:02 +0000 |
| Subject: | note 50697 added to features.commandline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86055@lists.php.net to get a copy of this message | ||
If you want to pass directly PHP code to the interpreter and you don't have only CGI, not the
CLI SAPI so you miss the -r option.
If you're lucky enough to be on a nix like system, then tou can still use the pipe solution as
the 3. way to command CLI SAPI described above, using a pipe ('|').
Then works for CGI SAPI:
$ echo '<?php echo "coucou\n"; phpinfo(); /* or any code */ ?>' | php
NOTE: unlike commands passed to the -r option, here you NEED the PHP tags.
----
Manual Page -- http://www.php.net/manual/en/features.commandline.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+50697
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+50697&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+50697&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+50697&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+50697&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+50697&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+50697&report=yes
Search -- http://master.php.net/manage/user-notes.php