php 源码安装常见问题汇总
2020-01-16 本文已影响0人
迷途大灰狼
本文章下载源安装的都是默认一个版本,如果需要安装其他版本,跳转:https://pkgs.org/download/libzip
configure: error: Package requirements (libwebp) were not met:No package 'libwebp' found
yum install libwebp-devel
或者
//libwebp-devel
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libwebp-devel-0.3.0-7.el7.x86_64.rpm
yum localinstall libwebp-devel-0.3.0-7.el7.x86_64.rpm
configure: error: Package requirements (libzip >= 0.11) were not met: Requested 'libzip >= 0.11' but version of libzip is 0.10.1
方法一:yum命令自动安装,如果你源没有的话只能走方法二
yum install libzip
yum install libzip-devel
方法二:下载源安装
下载源安装libzip 0.11和libzip-devel 0.11版本,
//安装libzip
wget http://packages.psychotic.ninja/7/plus/x86_64/RPMS//libzip-0.11.2-6.el7.psychotic.x86_64.rpm
yum localinstall libzip-0.11.2-6.el7.psychotic.x86_64.rpm
//安装libzip-devel
wget http://packages.psychotic.ninja/7/plus/x86_64/RPMS//libzip-devel-0.11.2-6.el7.psychotic.x86_64.rpm
yum localinstall libzip-devel-0.11.2-6.el7.psychotic.x86_64.rpm
configure: error: Package requirements (sqlite3 > 3.7.4) were not met:No package 'sqlite3' found
yum install sqlite-devel
configure: error: Package requirements (oniguruma) were not met:No package 'oniguruma' found
方法一
yum install oniguruma
yum install oniguruma-devel
方法二
到centos官网https://cbs.centos.org/koji/buildinfo?buildID=21477
wget http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/oniguruma-5.9.5-3.el7.art.x86_64.rpm
yum localinstall oniguruma-5.9.5-3.el7.art.x86_64.rpm
wget http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/oniguruma-devel-5.9.5-3.el7.art.x86_64.rpm
yum localinstall oniguruma-devel-5.9.5-3.el7.art.x86_64.rpm
拓展安装报错:Warning: PHP Startup: Invalid library (maybe not a PHP library) '*.so' in Unknown on lin
解决方法
make clean //清除上次的make命令所产生的object文件(后缀为“.o”的文件)及可执行文件。
然后再来一次 ./configure ******的编译
Warning: Module 'mysqli' already loaded in Unknown on line 0
出现这个时候,证明重复加载了,去php.ini把对应的extension 屏蔽就好了,然后再php -m查看一下对应扩展是否加载了
checking for cURL 7.15.5 or greater... configure: error: cURL version 7.15.5 or later is required to compile php with cURL support
执行以下命令安装最新版本的curl即可
yum install -y curl-devel
configure: error: xml2-config not found. Please check your libxml2 installation.
#rpm -qa |grep libxml2
libxml2-2.6.26-2.1.12
libxml2-python-2.6.26-2.1.12
重新安装libxml2和libxml2-devel包
yum install libxml2
yum install libxml2-devel -y
安装完之后查找xml2-config文件是否存在
# find / -name "xml2-config"
/usr/bin/xml2-config
如果存在的话重新安装php
# ./configure
之后再进行编译
make && make install
configure: error: Please reinstall the BZip2 distribution
执行以下命令安装对应开发包即可
yum install bzip2 bzip2-devel
configure: error: jpeglib.h not found.
执行以下命令安装对应开发包即可
yum -y install libjpeg-devel
configure: error: png.h not found.
执行以下命令安装对应开发包即可
yum install libpng-devel
Configure: error: freetype.h not found
执行以下命令安装对应开发包即可
yum install freetype-devel
xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
yum -y install libxslt libxslt-devel
configure: error: Please reinstall the libzip distribution
yum install libzip-devel
checking for libzip... configure: error: system libzip must be upgraded to version >= 0.11
libzip的版本问题,去官网下载最新的安装https://libzip.org/download/
wget https://nih.at/libzip/libzip-1.2.0.tar.gz
tar -xf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make
make install
configure: error: off_t undefined; check your library configuration
vim /etc/ld.so.conf
#添加如下几行
/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64
#保存退出
:wq
ldconfig -v # 使之生效
Cannot find OpenSSL's evp.h
这错误是缺少openssl相关的库导致的,安装一下openssl的库就好了
yum install openssl openssl-devel