編譯PHP報錯:configure: error: xml2-config not found. Please check your libxml2 installation.

root@d99f6263f227:/tmp/php-5.6.40# phpize
Cannot find config.m4. 
Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module

root@d99f6263f227:/tmp/php-5.6.40# ./configure -with-php-config=/usr/bin/php-config5.6
configure: WARNING: unrecognized options: --with-php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out

...

...

...

Configuring extensions
checking size of long... (cached) 8
checking size of int... (cached) 4
checking for int32_t... yes
checking for uint32_t... yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... yes
checking for atoll... yes
checking for strftime... (cached) yes
checking which regex library to use... php
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path... 

configure: error: xml2-config not found. Please check your libxml2 installation.
root@d99f6263f227:/tmp/php-5.6.40#    

解決辦法:
重新安裝libxml2和libxml2-devel包

apt-get install libxml2* -y

或者

yum install libxml2* -y
#yum install libxml2 -y
#yum install libxml2-devel -y

發佈了73 篇原創文章 · 獲贊 15 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章