Subcommands (3)
Options (7)
-l, --syntax-checkbooleanCheck syntax on (i.e. [l]int) a PHP script
Example:
php {{[-l|--syntax-check]}} {{path/to/file}}-a, --interactivebooleanRun PHP inter[a]ctively
Example:
php {{[-a|--interactive]}}-r, --runbooleanRun PHP code (Notes: Don't use `<? ?>` tags; escape double quotes with backslash)
Example:
php {{[-r|--run]}} "{{code}}"-S, --serverbooleanStart a PHP built-in web server in the current directory
Example:
php {{[-S|--server]}} {{host}}:{{port}}-m, --modulesbooleanList installed PHP extensions
Example:
php {{[-m|--modules]}}-i, --infobooleanDisplay information about the current PHP configuration
Example:
php {{[-i|--info]}}--rfbooleanDisplay information about a specific function
Example:
php {{[--rf|--rfunction]}} {{function_name}}Examples (8)
Parse and execute a PHP script
php path/to/fileCheck syntax on (i.e. [l]int) a PHP script
php [-l|--syntax-check] path/to/fileRun PHP inter[a]ctively
php [-a|--interactive]Run PHP code (Notes: Don't use `<? ?>` tags; escape double quotes with backslash)
php [-r|--run] "code"Start a PHP built-in web server in the current directory
php [-S|--server] host:portList installed PHP extensions
php [-m|--modules]Display information about the current PHP configuration
php [-i|--info]Display information about a specific function
php [--rf|--rfunction] function_namemade by @shridhargupta | data from tldr-pages