编译php时的一些错误和解决方法
php编译的时候执行 ./configure:
- configure: error: Cannot find libz
解决方法:
sudo apt install zlib1g-dev -y
- configure: error: jpeglib.h not found
解决方法:
sudo apt install libjpeg-dev -y
-
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
解决方法:
sudo apt install libcurl4-gnutls-dev -y
-
configure: error: png.h not found.
解决方法:
sudo apt install libpng3 libpng12-dev -y
-
configure: error: libXpm.(a|so) not found
解决方法:
在运行以下命令, 查看文件在哪个目录:
1 find /usr/lib/x86_64-linux-gnu/ -iname "libXpm.*" 2 find /usr/lib/x64/ -iname "libXpm.*"
然后将文件软连接到/usr/lib目录中, 例如:
1 sudo ln -s /usr/lib/x86_64-linux-gnu/libXpm.a /usr/lib/libXpm.a 2 sudo ln -s /usr/lib/x86_64-linux-gnu/libXpm.so /usr/lib/libXpm.so
- configure: error: freetype-config not found
解决方法:
sudo apt install libfreetype6-dev -y
- configure: error: mcrypt.h not found. Please reinstall libmcrypt
解决方法:
sudo apt install libmcrypt-dev -y
总结一下需要安装的东西(enable不同的扩展, 需要安装不一定一样):
sudo apt install libmcrypt-dev libfreetype6-dev libpng3 libpng12-dev libcurl4-gnutls-dev libjpeg-dev zlib1g-dev -y