2014-02-27 19:20:14 +00:00
|
|
|
# php
|
|
|
|
|
2021-05-20 21:13:41 +01:00
|
|
|
> PHP command-line interface.
|
2019-05-29 14:53:46 +01:00
|
|
|
> More information: <https://php.net>.
|
2014-02-27 19:20:14 +00:00
|
|
|
|
2021-08-15 18:59:09 +01:00
|
|
|
- Parse and execute a PHP script:
|
2014-02-27 19:20:14 +00:00
|
|
|
|
2022-12-04 09:12:49 +00:00
|
|
|
`php {{path/to/file}}`
|
2014-02-27 19:20:14 +00:00
|
|
|
|
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
|
|
|
|
2022-12-04 09:12:49 +00:00
|
|
|
`php -l {{path/to/file}}`
|
2014-02-27 19:30:03 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- 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
|
|
|
|
2015-10-28 08:33:06 +00:00
|
|
|
`php -r "{{code}}"`
|
2015-12-28 13:30:32 +00:00
|
|
|
|
2016-01-07 17:31:27 +00:00
|
|
|
- Start a PHP built-in web server in the current directory:
|
2015-12-28 13:30:32 +00:00
|
|
|
|
|
|
|
`php -S {{host:port}}`
|
2019-03-23 22:17:46 +00:00
|
|
|
|
2024-01-31 03:55:19 +00:00
|
|
|
- List installed PHP extensions:
|
2019-03-23 22:17:46 +00:00
|
|
|
|
|
|
|
`php -m`
|
2019-04-28 13:05:08 +01:00
|
|
|
|
|
|
|
- Display information about the current PHP configuration:
|
|
|
|
|
|
|
|
`php -i`
|
2021-10-26 08:45:10 +01:00
|
|
|
|
|
|
|
- Display information about a specific function:
|
|
|
|
|
|
|
|
`php --rf {{function_name}}`
|