2014-02-27 16:20:14 -03:00
|
|
|
# php
|
|
|
|
|
2021-05-20 16:13:41 -04:00
|
|
|
> PHP command-line interface.
|
2019-05-29 14:53:46 +01:00
|
|
|
> More information: <https://php.net>.
|
2014-02-27 16:20:14 -03:00
|
|
|
|
2021-08-15 19:59:09 +02:00
|
|
|
- Parse and execute a PHP script:
|
2014-02-27 16:20:14 -03:00
|
|
|
|
2022-12-04 10:12:49 +01:00
|
|
|
`php {{path/to/file}}`
|
2014-02-27 16:20:14 -03:00
|
|
|
|
2025-05-28 19:35:08 +00:00
|
|
|
- Check syntax on (i.e. [l]int) a PHP script:
|
2014-02-27 16:30:03 -03:00
|
|
|
|
2025-05-28 19:35:08 +00:00
|
|
|
`php {{[-l|--syntax-check]}} {{path/to/file}}`
|
2014-02-27 16:30:03 -03:00
|
|
|
|
2025-05-28 19:35:08 +00:00
|
|
|
- Run PHP inter[a]ctively:
|
2014-02-27 16:20:14 -03:00
|
|
|
|
2025-05-28 19:35:08 +00:00
|
|
|
`php {{[-a|--interactive]}}`
|
2014-02-27 16:20:14 -03:00
|
|
|
|
2016-11-05 18:59:21 +00:00
|
|
|
- Run PHP code (Notes: Don't use <? ?> tags; escape double quotes with backslash):
|
2014-02-27 16:20:14 -03:00
|
|
|
|
2025-05-28 19:35:08 +00:00
|
|
|
`php {{[-r|--run]}} "{{code}}"`
|
2015-12-28 14:30:32 +01:00
|
|
|
|
2025-05-28 19:35:08 +00:00
|
|
|
- Start a PHP built-in web [S]erver in the current directory:
|
2015-12-28 14:30:32 +01:00
|
|
|
|
2025-05-28 19:35:08 +00:00
|
|
|
`php {{[-S|--server]}} {{host:port}}`
|
2019-03-24 00:17:46 +02:00
|
|
|
|
2024-01-31 00:55:19 -03:00
|
|
|
- List installed PHP extensions:
|
2019-03-24 00:17:46 +02:00
|
|
|
|
2025-05-28 19:35:08 +00:00
|
|
|
`php {{[-m|--modules]}}`
|
2019-04-28 13:05:08 +01:00
|
|
|
|
|
|
|
- Display information about the current PHP configuration:
|
|
|
|
|
2025-05-28 19:35:08 +00:00
|
|
|
`php {{[-i|--info]}}`
|
2021-10-26 10:45:10 +03:00
|
|
|
|
|
|
|
- Display information about a specific function:
|
|
|
|
|
2025-05-28 19:35:08 +00:00
|
|
|
`php {{[--rf|--rfunction]}} {{function_name}}`
|