tldr/pages/common/php.md

25 lines
409 B
Markdown
Raw Normal View History

2014-02-27 19:20:14 +00:00
# php
> PHP command line interface.
2019-01-30 11:51:51 +00:00
> Homepage: <https://php.net>.
2014-02-27 19:20:14 +00:00
2016-11-05 18:59:21 +00:00
- Parse and execute a php script:
2014-02-27 19:20:14 +00:00
`php {{file}}`
2016-11-05 18:59:21 +00:00
- Check syntax on (i.e. lint) a PHP script:
2014-02-27 19:30:03 +00:00
`php -l {{file}}`
- Run PHP interactively:
2014-02-27 19:20:14 +00:00
`php -a`
2016-11-05 18:59:21 +00:00
- Run PHP code (Notes: Don't use <? ?> tags; escape double quotes with backslash):
2014-02-27 19:20:14 +00:00
`php -r "{{code}}"`
- Start a PHP built-in web server in the current directory:
`php -S {{host:port}}`