关于php:服务器上PHP安装配置问题与解决方法未完待续

6次阅读

共计 1978 个字符,预计需要花费 5 分钟才能阅读完成。

采纳源码的形式装置 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.1
mkdir build
cd build
cmake ..
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/images
rm -rf /home/opt/images/swap
dd 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   available
Mem:            992         178         137           0         676         670
Swap:          1999         112        1887

Step4 回到 php 装置目录,从新编译

make && make install

Step5 应用结束,敞开文件

cd /home/opt/images/
swapoff swap
rm -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-dev
sudo 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 / Debian
sudo apt-get install libcurl4-openssl-dev

# RHEL / CentOS
sudo yum install libcurl-devel

# Mac OS
brew install curl
正文完
 0