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/