由于我们习惯编译安装最小化的功能模块,所以我们在编译php时候会遇到很多编译上的报错,今天就来汇总下常遇到的编译错误和解决方法。
./configure --prefix=/usr/local/php5 --with-config-file-path=/usr/local/php5/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-pdo-mysql=/usr/local/mysql --with-gd --with-iconv --with-zlib --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session --with-mcrypt --with-curl --with-jpeg-dir --with-freetype-dir出现得错误如下:
错误一:
configure: error: xml2-config not found. Please check your libxml2 installation.而我已经安装过了libxml2,但是还是有这个提示:
解决办法:
sudo apt-get install libxml2-dev错误二:
configure: error: Please reinstall the BZip2 distribution而我也已经安装了bzip2,网上找到得解决方案都是需要安装bzip2-dev,可是11.10里面没有这个库。
解决办法:在网上找到bzip2-1.0.5.tar.gz,解压,直接make ,sudo make install.(我使用的该源来自于http://ishare.iask.sina.com.cn/f/9769001.html)
错误三:
configure: error: Please reinstall the libcurl distribution -easy.h should be in /include/curl/解决办法:
sudo apt-get install libcurl4-gnutls-dev错误四:
configure: error: jpeglib.h not found.解决办法:
sudo apt-get install libjpeg-dev错误五:
configure: error: png.h not found.解决办法:
sudo apt-get install libpng-dev错误六:
configure: error: libXpm.(a|so) not found.解决办法:
sudo apt-get install libxpm-dev错误七:
configure: error: freetype.h not found.解决办法:
sudo apt-get install libfreetype6-dev错误八:
configure: error: Your t1lib distribution is not installed correctly. Please reinstall it.解决办法:
sudo apt-get install libt1-dev错误九:
configure: error: mcrypt.h not found. Please reinstall libmcrypt.解决办法:
sudo apt-get install libmcrypt-dev错误十:
configure: error: Cannot find MySQL header files under yes.
Note that the MySQL client library is not bundled anymore!解决办法:
sudo apt-get install libmysql++-dev错误十一:
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution解决办法:
sudo apt-get install libxslt1-dev可见PHP源码安装之前需要先安装这些依赖,详细可见http://forum.ubuntu.org.cn/viewtopic.php?f=88&t=231159
如上错误都解决之后,再次./config….没有错误之后
make
sudo make install
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://sulao.cn/post/363
相关阅读
- ubuntu22.04算力环境基础配置一键验证脚本
- ubuntu22.04算力环境基础配置一键脚本
- ubuntu22.04忘记root密码进入单用户模式修改密码
- ubuntu22.04屏蔽使用apt安装软件时出现弹窗要求选择重启服务的方法
- ubuntu22.04删除系统中的新内核并回退的方法
- ubuntu22.04部署chrony时间同步服务
- ubuntu22.04部署ntp时间同步服务器
- ubuntu22.04切换cgroup v2到cgroup v1
- ubuntu22.04安装nvidia-fabricmanager
- ubuntu22.04使用containerd部署k8s单master集群
评论列表