PHP安裝後php-config命令幹嘛的

來源:互聯網
上載者:User

標籤:

php-config 是一個簡單的命令列指令碼用於查看所安裝的 PHP 配置的資訊。

我們在命令列執行 php-config 會輸出所有的配置資訊

Usage: /usr/local/php/bin/php-config [OPTION]Options:  --prefix            [/usr/local/php]  --includes          [-I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib]  --ldflags           [ -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/lib -L/usr/local/lib -L/usr/local/mysql/lib]  --libs              [  -lz -lresolv -lmysqlclient -lmcrypt -lpng -lz -lcurl -lm  -lxml2 -lz -licucore -lm -lcurl -lxml2 -lz -licucore -lm -lmysqlclient -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm ]  --extension-dir     [/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226]  --include-dir       [/usr/local/php/include/php]  --man-dir           [/usr/local/php/php/man]  --php-binary        [/usr/local/php/bin/php]  --php-sapis         [ cli fpm cgi]  --configure-options [--prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-curl --enable-fpm --with-mcrypt --with-mhash --with-gd -enable-zip --enable-fastCGI --without-iconv]  --version           [5.6.21]  --vernum            [50621]

 

其實php-config只是一個指令碼而已

我們先查一下php-config在哪,然後開啟檔案研究一番

 

where php-configlocalhost% where php-config/usr/local/php/bin/php-config/usr/bin/php-configlocalhost% vim /usr/local/php/bin/php-config

 

指令碼內容如下

#! /bin/shSED="/usr/bin/sed"prefix="/usr"datarootdir="/usr/php"exec_prefix="${prefix}"version="5.5.30"vernum="50530"include_dir="${prefix}/include/php"includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib"ldflags=" -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.Internal.sdk/usr/lib "libs="-lresolv  -lcrypto -lssl -lcrypto -lz -lexslt -ltidy -lresolv -ledit -lncurses -lldap -llber -liconv -liconv -lpng -lz -ljpeg -lcrypto -lssl -lcrypto -lcurl -lbz2 -lz -lpcre -lcrypto -lssl -lcrypto -lm  -lxml2 -lz -licucore -lm -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lcurl -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lnetsnmp -lcrypto -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lz -licucore -lm -lxml2 -lxslt "extension_dir=‘/usr/lib/php/extensions/no-debug-non-zts-20121212‘man_dir=`eval echo /usr/share/man`program_prefix=""program_suffix=""exe_extension=""php_cli_binary=NONEphp_cgi_binary=NONEconfigure_options=" ‘--prefix=/usr‘ ‘--mandir=/usr/share/man‘ ‘--infodir=/usr/share/info‘ ‘--disable-dependency-tracking‘ ‘--sysconfdir=/private/etc‘ ‘--with-libdir=lib‘ ‘--enable-cli‘ ‘--with-iconv=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.Internal.sdk/usr‘ ‘--with-config-file-path=/etc‘ ‘--with-config-file-scan-dir=/Library/Server/Web/Config/php‘ ‘--with-libxml-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.Internal.sdk/usr‘ ‘--with-openssl=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.Internal.sdk/usr/local"php_sapis=" apache2handler cli fpm"# Set php_cli_binary and php_cgi_binary if availablefor sapi in $php_sapis; do  case $sapi in  cli)    php_cli_binary="${exec_prefix}/bin/${program_prefix}php${program_suffix}${exe_extension}"    ;;  cgi)    php_cgi_binary="${exec_prefix}/bin/${program_prefix}php-cgi${program_suffix}${exe_extension}"    ;;  esacdone# Determine which (if any) php binary is availableif test "$php_cli_binary" != "NONE"; then  php_binary="$php_cli_binary"else  php_binary="$php_cgi_binary"fi# Remove quotesconfigure_options=`echo $configure_options | $SED -e "s#‘##g"`case "$1" in--prefix)  echo $prefix;;--includes)  echo $includes;;--ldflags)  echo $ldflags;;--libs)  echo $libs;;--extension-dir)  echo $extension_dir;;--include-dir)  echo $include_dir;;--php-binary)  echo $php_binary;;--php-sapis)  echo $php_sapis;;--configure-options)  echo $configure_options;;--man-dir)  echo $man_dir;;--version)  echo $version;;--vernum)  echo $vernum;;*)  cat << EOFUsage: $0 [OPTION]Options:  --prefix            [$prefix]  --includes          [$includes]  --ldflags           [$ldflags]  --libs              [$libs]  --extension-dir     [$extension_dir]  --include-dir       [$include_dir]  --man-dir           [$man_dir]  --php-binary        [$php_binary]  --php-sapis         [$php_sapis]  --configure-options [$configure_options]  --version           [$version]  --vernum            [$vernum]EOF  exit 1;;esacexit 0

 

PHP安裝後php-config命令幹嘛的

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.