采纳源码的形式装置PHP,在编译(./configure ....
)时往往会遇到各种各样的报错和提醒,整顿一些可能会遇到的装置问题和相干解决办法,继续更新
1. Please reinstall the libzip distribution
参考资料
https://www.cnblogs.com/gyfluck/p/10478386.html
降级Cmake,以后服务器的cmake版本较低,须要重新安装最高版本
以后cmake是最新版本间接跳过此步骤
# 删除以后已装置yum remove cmake# 下载wget https://cmake.org/files/v3.14/cmake-3.14.5.tar.gz# 解压缩tar zxvf cmake-3.14.5.tar.gz# 配置./configure --prefix=/usr/local/cmake# 装置 make && make install # 创立链接 ln -s /usr/local/cmake/bin/cmake /usr/bin/cmake # 查看版本 cmake -version
装置最新版本的libzip
# 删除旧版本yum remove libzip libzip-devel# 下载新版本curl https://libzip.org/download/libzip-1.5.1.tar.gz# 解压到当前目录tar -zxvf libzip-1.5.1.tar.gz# 配置 & 装置cd libzip-1.5.1mkdir buildcd buildcmake ..make && make install
2. off_t undefined; check your library configuration
参考资讯
https://blog.csdn.net/github_38336924/article/details/88898655
第一步
echo '/usr/local/lib64/usr/local/lib/usr/lib/usr/lib64'>>/etc/ld.so.conf
第二步
ldconfig -v
3. unrecognized options: –with-mcrypt, –enable-gd-native-ttf
参考资料
https://www.qinziheng.com/php/4869.htm
将以上两个编译选项删除
4. unrecognized options: --with-mysql
参考资料
https://blog.csdn.net/zhou75771217/article/details/83303058
php7版本不反对mysql模块
改用--with-pdo-mysql
5. virtual memory exhausted: Cannot allocate memory
参考资料
https://www.cnblogs.com/chenpingzhao/p/4820814.html
起因:服务器的虚拟内存有余引起的报错
解决:自行调配虚拟内存,再进行编译
查看以后配置
free -m
Step1 创立虚拟内存文件
mkdir /home/opt/imagesrm -rf /home/opt/images/swapdd if=/dev/zero of=/home/opt/images/swap bs=1024 count=2048000
Step2 启用文件
mkswap /home/opt/images/swap
Step3 查看是否配置胜利,执行 free -m
total used free shared buff/cache availableMem: 992 178 137 0 676 670Swap: 1999 112 1887
Step4 回到php装置目录,从新编译
make && make install
Step5 应用结束,敞开文件
cd /home/opt/images/swapoff swaprm -f /home/opt/images/swap
6. No package ‘sqlite3‘ found
sudo apt-get install libsqlite3-dev
7. Please reinstall the BZip2 distribution
sudo apt-get install libbz2-devsudo yum install bzip2-devel
8. Package requirements (libcurl >= 7.15.5) were not met
参考地址:https://www.cpming.top/p/package-requirements-libcurl-7-15-5-were-not-met
# Ubuntu / Debiansudo apt-get install libcurl4-openssl-dev# RHEL / CentOSsudo yum install libcurl-devel# Mac OSbrew install curl