php xml2-config,mac 编译 php7 错误:checking for xml2-config path... /usr/bin/xml2-config checking whethe...

checking libxml2 install dir... no

checking for xml2-config path... /usr/bin/xml2-config

checking whether libxml build works... no

configure: error: build test failed. Please check the config.log for details.

参考

方案一

可以在生成 makefile 的时候,使用--disable-libxml

方案二

安装libxml2并且通过--with-libxml-dir指定xml2-config所在目录。如果安装在了/usr/local/bin/或者/usr/bin/就不用特殊制定了。$ brew upgrade libxml2

If you need to have this software first in your PATH run:

echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.bash_profile

For compilers to find this software you may need to set:

LDFLAGS: -L/usr/local/opt/libxml2/lib

CPPFLAGS: -I/usr/local/opt/libxml2/include

For pkg-config to find this software you may need to set:

PKG_CONFIG_PATH: /usr/local/opt/libxml2/lib/pkgconfig

If you need Python to find bindings for this keg-only formula, run:

echo /usr/local/opt/libxml2/lib/python2.7/site-packages >> /usr/local/lib/python2.7/site-packages/libxml2.pth

mkdir -p /Users/zhoumengkang/Library/Python/2.7/lib/python/site-packages

echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/zhoumengkang/Library/Python/2.7/lib/python/site-packages/homebrew.pth

==> Summary

然后指定libxml目录./configure --prefix=/Users/zhoumengkang/php_debug --with-config-file-path=/Users/zhoumengkang/php_debug/etc --enable-debug --with-iconv=/usr/local/opt/libiconv --with-libxml-dir=/usr/local/opt/libxml2

安装完成

我使用的第二种方案$ make && make install

Installing shared extensions: /Users/zhoumengkang/php_debug/lib/php/extensions/debug-non-zts-20151012/

Installing PHP CLI binary: /Users/zhoumengkang/php_debug/bin/

Installing PHP CLI man page: /Users/zhoumengkang/php_debug/php/man/man1/

Installing phpdbg binary: /Users/zhoumengkang/php_debug/bin/

Installing phpdbg man page: /Users/zhoumengkang/php_debug/php/man/man1/

Installing PHP CGI binary: /Users/zhoumengkang/php_debug/bin/

Installing PHP CGI man page: /Users/zhoumengkang/php_debug/php/man/man1/

Installing build environment: /Users/zhoumengkang/php_debug/lib/php/build/

Installing header files: /Users/zhoumengkang/php_debug/include/php/

Installing helper programs: /Users/zhoumengkang/php_debug/bin/

program: phpize

program: php-config

Installing man pages: /Users/zhoumengkang/php_debug/php/man/man1/

page: phpize.1

page: php-config.1

Installing PEAR environment: /Users/zhoumengkang/php_debug/lib/php/

--2017-11-10 13:43:18-- https://pear.php.net/install-pear-nozlib.phar

Resolving pear.php.net... 109.203.101.62

Connecting to pear.php.net|109.203.101.62|:443... connected.

HTTP request sent, awaiting response... 200 OK

Length: 3610262 (3.4M) [text/plain]

Saving to: ‘pear/install-pear-nozlib.phar’

install-pear-nozlib.phar 100%[===========================================================================================>] 3.44M 341KB/s in 16s

2017-11-10 13:43:40 (214 KB/s) - ‘pear/install-pear-nozlib.phar’ saved [3610262/3610262]

[PEAR] Archive_Tar - installed: 1.4.3

[PEAR] Console_Getopt - installed: 1.4.1

[PEAR] Structures_Graph- installed: 1.1.1

[PEAR] XML_Util - installed: 1.4.2

[PEAR] PEAR - installed: 1.10.5

Wrote PEAR system config file at: /Users/zhoumengkang/php_debug/etc/pear.conf

You may want to add: /Users/zhoumengkang/php_debug/lib/php to your php.ini include_path

/Users/zhoumengkang/IdeaProjects/php/php-src/build/shtool install -c ext/phar/phar.phar /Users/zhoumengkang/php_debug/bin

ln -s -f phar.phar /Users/zhoumengkang/php_debug/bin/phar

Installing PDO headers: /Users/zhoumengkang/php_debug/include/php/ext/pdo/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值