Direct PHP code to execute the command line (PHP the CLI mode)

Generally execute PHP code, PHP code needs to be written to a file, but sometimes check some PHP configuration does not need, can not be directly executed PHP code?

The answer is yes.

The command line, using the CLI PHP code to execute, there are a few common commands.

1) execute PHP code

-r PHP "phpinfo ();"
2) See the PHP version (if it is -V parameter, PHP compiler output parameters)

-v php
. 3) arranged to view the phpinfo
php -i
. 4) loaded viewing module php
php -m

Guess you like

Origin www.cnblogs.com/fuoryao/p/11866674.html