note 50697 deleted from features.commandline by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 10:16:15 +0000 |
| Subject: | note 50697 deleted from features.commandline by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196959@lists.php.net to get a copy of this message | ||
Note Submitter: bertrand at toggg dot com
----
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.