commands.sh

php

all

PHP command-line interface.

More info →

Options (7)

-l, --syntax-checkboolean

Check syntax on (i.e. [l]int) a PHP script

Example: php {{[-l|--syntax-check]}} {{path/to/file}}
-a, --interactiveboolean

Run PHP inter[a]ctively

Example: php {{[-a|--interactive]}}
-r, --runboolean

Run PHP code (Notes: Don't use `<? ?>` tags; escape double quotes with backslash)

Example: php {{[-r|--run]}} "{{code}}"
-S, --serverboolean

Start a PHP built-in web server in the current directory

Example: php {{[-S|--server]}} {{host}}:{{port}}
-m, --modulesboolean

List installed PHP extensions

Example: php {{[-m|--modules]}}
-i, --infoboolean

Display information about the current PHP configuration

Example: php {{[-i|--info]}}
--rfboolean

Display information about a specific function

Example: php {{[--rf|--rfunction]}} {{function_name}}

Examples (8)

Parse and execute a PHP script

php path/to/file

Check syntax on (i.e. [l]int) a PHP script

php [-l|--syntax-check] path/to/file

Run 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:port

List 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_name
made by @shridhargupta | data from tldr-pages