zoukankan      html  css  js  c++  java
  • PHP安装后php-config命令干嘛的

    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-config
    
    localhost% where php-config
    
    /usr/local/php/bin/php-config
    
    /usr/bin/php-config
    
    localhost% vim /usr/local/php/bin/php-config

    脚本内容如下

    #! /bin/sh
    
    SED="/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=NONE
    php_cgi_binary=NONE
    configure_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 available
    for 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}"
        ;;
      esac
    done
    
    # Determine which (if any) php binary is available
    if test "$php_cli_binary" != "NONE"; then
      php_binary="$php_cli_binary"
    else
      php_binary="$php_cgi_binary"
    fi
    
    # Remove quotes
    configure_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 << EOF
    Usage: $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;;
    esac
    
    exit 0
  • 相关阅读:
    千亿美元规模,云计算的下半场将走向何方?
    巧用云原生能力和工具,提升云上运维效率
    基础设施代码化(IaC)的自动化配置与编排
    盘点2020 | 阿里云弹性计算年度关键词:快、弹、稳
    整体算力提升40% 芯片级安全防护 | 阿里云发布第七代ECS云服务器
    真正云原生的智能运维体系,阿里云发布ECS自动化运维套件
    安装wireshark
    查看linux的登录日志 centos7
    CentOS查看系统当前登录用户信息的4种方法
    free -m查询内存使用情况,祥解
  • 原文地址:https://www.cnblogs.com/xiaozong/p/5725089.html
Copyright © 2011-2022 走看看