PHP命令列

jacklove
發布: 2023-03-31 16:58:02
原創
2144 人瀏覽過

PHP命令列

php命令

jinxu@jinxu-ubuntu:~$ php -h
Usage: php [options] [-f] <file> [--] [args...]
   php [options] -r <code> [--] [args...]
   php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
   php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
   php [options] -S <addr>:<port> [-t docroot] [router]
   php [options] -- [args...]
   php [options] -a
  -a               Run interactively  -c <path>|<file> Look for php.ini file in this directory  -n               No configuration (ini) files will be used  -d foo[=bar]     Define INI entry foo with value &#39;bar&#39;  -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 all input lines  -H               Hide any passed arguments from external tools.  -S <addr>:<port> Run with built-in web server.  -t <docroot>     Specify document root <docroot> for built-in web server.  -s               Output HTML syntax highlighted source.  -v               Version number  -w               Output source with stripped comments and 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
  --ini            Show configuration file names
  --rf <name>      Show information about function <name>.  --rc <name>      Show information about class <name>.  --re <name>      Show information about extension <name>.  --rz <name>      Show information about Zend extension <name>.  --ri <name>      Show configuration for extension <name>.
登入後複製
登入後複製

作為本機伺服器

  1. 進入到專案所在目錄

  2. shift 右鍵開啟命令列

  3. 執行php -S localhost:8000

  4. 瀏覽器中開啟localhost:8000

執行腳本

執行php [options] [-f] <file> [--] [args...]

互動式命令

執行php -a

PHP命令列

php命令

jinxu@jinxu-ubuntu:~$ php -h
Usage: php [options] [-f] <file> [--] [args...]
   php [options] -r <code> [--] [args...]
   php [options] [-B <begin_code>] -R <code> [-E <end_code>] [--] [args...]
   php [options] [-B <begin_code>] -F <file> [-E <end_code>] [--] [args...]
   php [options] -S <addr>:<port> [-t docroot] [router]
   php [options] -- [args...]
   php [options] -a
  -a               Run interactively  -c <path>|<file> Look for php.ini file in this directory  -n               No configuration (ini) files will be used  -d foo[=bar]     Define INI entry foo with value &#39;bar&#39;  -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 all input lines  -H               Hide any passed arguments from external tools.  -S <addr>:<port> Run with built-in web server.  -t <docroot>     Specify document root <docroot> for built-in web server.  -s               Output HTML syntax highlighted source.  -v               Version number  -w               Output source with stripped comments and 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
  --ini            Show configuration file names
  --rf <name>      Show information about function <name>.  --rc <name>      Show information about class <name>.  --re <name>      Show information about extension <name>.  --rz <name>      Show information about Zend extension <name>.  --ri <name>      Show configuration for extension <name>.
登入後複製
登入後複製

作為本機伺服器

  1. 進入到專案所在目錄

  2. shift 右鍵開啟命令列

  3. 執行php -S localhost:8000

  4. 瀏覽器中開啟localhost:8000

#執行腳本

執行php [options] [-f] <file> [--] [args...]

#互動式指令

#執行php -a

本文介紹了PHP命令列,更多相關內容請關注php中文網。

相關推薦:

PHP取得客戶端資訊

PHP 時間處理

php編輯使用者資訊

#

以上是PHP命令列的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
php
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!