2014-02-27 23:20:14 +04:00
|
|
|
# php
|
|
|
|
|
2016-11-05 21:55:29 +03:00
|
|
|
> PHP command line interface.
|
2014-02-27 23:20:14 +04:00
|
|
|
|
2016-11-05 21:59:21 +03:00
|
|
|
- Parse and execute a php script:
|
2014-02-27 23:20:14 +04:00
|
|
|
|
|
|
|
`php {{file}}`
|
|
|
|
|
2016-11-05 21:59:21 +03:00
|
|
|
- Check syntax on (i.e. lint) a PHP script:
|
2014-02-27 23:30:03 +04:00
|
|
|
|
|
|
|
`php -l {{file}}`
|
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Run PHP interactively:
|
2014-02-27 23:20:14 +04:00
|
|
|
|
|
|
|
`php -a`
|
|
|
|
|
2016-11-05 21:59:21 +03:00
|
|
|
- Run PHP code (Notes: Don't use <? ?> tags; escape double quotes with backslash):
|
2014-02-27 23:20:14 +04:00
|
|
|
|
2015-10-28 11:33:06 +03:00
|
|
|
`php -r "{{code}}"`
|
2015-12-28 16:30:32 +03:00
|
|
|
|
2016-01-07 20:31:27 +03:00
|
|
|
- Start a PHP built-in web server in the current directory:
|
2015-12-28 16:30:32 +03:00
|
|
|
|
|
|
|
`php -S {{host:port}}`
|