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..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-]
--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.]
--vernum []

其实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=""
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: $ [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 ;;
esac exit

PHP安装后php-config命令干嘛的的更多相关文章

  1. fedora安装后,yum命令不能使用,Cannot retrieve metalink for repository: fedora. Please verify its path and try again 解决方法

    fedora安装后,yum命令不能使用,Cannot retrieve metalink for repository: fedora. Please verify its path and try ...

  2. git安装后配置--config

    安装git后需要配置一下环境,每台计算机上只需要配置一次,程序升级时会保留配置信息. 你可以在任何时候再次通过运行命令来修改它们. 通过git config命令来配置环境变量,这些变量存储在三个不同的 ...

  3. Python安装后在CMD命令行下出现“应用程序无法启动.............”问题

    问题存在之一:系统是刚刚重做的精简版服务器系统(阉割版) AN就是在阿里云上刚开的Windows Server 2008 系统上碰到的  吓尿了都 症状:            正常安装python环 ...

  4. CentOS7 mini安装后没有ifconfig命令的解决办法

    在CentOS 最小化mini安装后,没有ifconfig命令,此时网卡也没有启动,所以无法yum安装net-tools. 下面三步解决此问题: 1 查看网卡名称 ip addr 2 启动网卡 ifu ...

  5. CentOs7 minimal安装后没有ifconfig命令解决方法

    没有ifconfig命令目前我了解两个原因: 1./sbin/ifconfig 可以执行,但是ifconfig无法执行.这个解决的时候只需要将/sbin 添加到PATH下就可以了. 2.系统未安装if ...

  6. nvm-windows 安装后,node 命令报错

    下载地址: https://github.com/coreybutler/nvm-windows/releases 我是点下面这个直接安装的: 配置文件,我都是习惯在软件目录下建个 files 文件夹 ...

  7. CentOS 7 安装后没有ifconfig命令

    /bin,/sbin,/usr/bin,/usr/sbin下面都没有ifconfig命令. 执行命令  yum install net-tools 即可.

  8. Fedora最小化安装后没有ifconfig命令

    百度了很久,都说添加export PATH=$PATH:/sbin,结果我用whereis 查询了,根本没有这个命令.后来直接yum search ifconfig,查找到原来是net-tools包. ...

  9. FreeBSD安装后使用su命令显示sorry的解决办法

    FreeBSD中,可以使用su命令成为root用户,但FreeBSD对执行su命令的用户进行了更严格的限制,能使用su命令的用户必须属于wheel组(root的基本属组,组ID为0),否则就不能通过 ...

  10. Redis 配置 CONFIG 命令

    redis.conf 文件在 安装目录下 CONFIG 命令查看或设置配置项 先登陆 src/redis-cli -a -a 后面是密码,默认为空,没有密码直接登陆 src/redis-cli 1.查 ...

随机推荐

  1. Linux常用使用技巧

    一.如何实时查看linux下的日志 cat /var/log/*.log 如果日志在更新,如何实时查看 tail -f /var/log/messages 还可以使用 watch -d -n 1 ca ...

  2. sublime text3编译运行C,Java程序的一些配置

    环境:linux 64位 桌面环境: gnome Java编译运行 (1)Preferences --> Browse Packages --> 在该文件夹下新建build文件如: Myj ...

  3. validform 怎么验证小数。

    <input type="text" class="input-text" value="{$info.score}" placeho ...

  4. /tmp 和 /var/tmp 的区别

    /tmp is meant as fast (possibly small) storage with a short time to live (TTL). Many systems clean / ...

  5. @Transactional注解详解

    默认遇到throw new RuntimeException("...");会回滚   需要捕获的throw new Exception("...");不会回滚 ...

  6. 在Wamp 添加站点和域名

    在httpd.conf中使Include conf/extra/httpd-vhosts.conf生效 在conf/extra/httpd-vhosts.conf中加入如下代码 <Virtual ...

  7. 深入浅出聊Unity3D项目优化:从Draw Calls到GC

    前言: 刚开始写这篇文章的时候选了一个很土的题目...<Unity3D优化全解析>.因为这是一篇临时起意才写的文章,而且陈述的都是既有的事实,因而给自己“文(dou)学(bi)”加工留下的 ...

  8. MvcPager

    站点网址:http://www.webdiyer.com/mvcpager/ 控制台命令:Install-Package Webdiyer.MvcPager

  9. oracle 11g高级 安装图解(摘自网络)

    使用的高级安装 启动OUI后出现“选择安装方式”窗口,我们选择:高级安装 步骤3:出现“选择安装类型”窗口,选择我们需要安装的版本.我们在此肯定是选择企业版. 至于产品语言不用选择,它会根据当前系统的 ...

  10. Chrome 自动填充的表单是淡黄色的背景怎么办!

    chrome浏览器自动填充表单的黄色背景高亮(#FAFFBD)一直困扰着我,我之前没想着理它,可是最近一个登陆框,需要用到图标,于是我草率的直接设置在input元素里面,结果问题就来了,很难看很难看, ...