PHP Tutorials - Herong's Tutorial Examples
Dr. Herong Yang, Version 3.00

"php -help" - Command Line Options

This section provides a tutorial example on how to see all command line options supported by the PHP engine: php -help.

If you want to know what command line options are supported by the PHP engine, you can run PHP with the "-help" option:

>\php\php -help
Usage: php [options] [-f] <file> [--] [args...]
       php [options] -r <code> [--] [args...]
       php [options] -- [args...]
       php [options] -a

  -a               Run interactively
  -c <path>|<file> Look for php.ini file in this directory
  -n               No php.ini file will be used
  -d foo[=bar]     Define INI entry foo with value 'bar'
  -e               Generate extended information for debugger/profiler
  -f <file>        Parse and execute <file>.
  -h               This help
  -i               PHP information
  -l               Syntax check only (lint)
  -m               Show compiled in modules
  -r <code>        Run PHP <code> without using script tags <?..?>
  -B <begin_code>  Run PHP <begin_code> before processing input lines
  -R <code>        Run PHP <code> for every input line
  -F <file>        Parse and execute <file> for every input line
  -E <end_code>    Run PHP <end_code> after processing input lines
  -H               Hide any passed arguments from external tools.
  -s               Display colour syntax highlighted source.
  -v               Version number
  -w               Display source with stripped comments & whitespace.
  -z <file>        Load Zend extension <file>.

  args...          Arguments passed to script. Use -- args when first
                   argument starts with - or script is read from stdin

  --rf <name>      Show information about function <name>.
  --rc <name>      Show information about class <name>.
  --re <name>      Show information about extension <name>.
  --ri <name>      Show configuration for extension <name>.

Last update: 2007.

Sections in This Chapter

What Is PHP?

Downloading and Installing PHP 5.0.4 for Windows

Downloading and Installing PHP 5.2.2 for Windows

"php -help" - Command Line Options

"php -m" - Compiled-in Modules

"php -i" - PHP Engine Information

Hello.php - My First PHP Script

Adding PHP to IIS as CGI

Dr. Herong Yang, updated in 2009
"php -help" - Command Line Options