• 我们中的有些人,注定要在日常生活的点滴中去寻找生命的意义。---- 《生活大爆炸》|

centos7安装php7.3.5踩坑

PHP admin 7个月前 (05-17) 346次浏览 已收录 0个评论

1. system libzip must be upgraded to version >= 0.11

根据提示我们可以清楚的知道是因为系统自带的libzip版本低了,这里我们需要安装最新的libzip
首先,卸载系统自带的libzip
yum -y remove libzip-devel
然后从官网下载并编译安装
wget https://libzip.org/download/libzip-1.3.2.tar.gz
tar xvf libzip-1.3.2.tar.gz
cd libzip-1.3.2
./configure
make && make install

如果是下载1.5.*以上版本,则需要采用如下安装方式
yum -y install cmake
wget 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

添加搜索路径到配置文件
echo ‘/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64’>>/etc/ld.so.conf
更新配置
ldconfig -v

PS: 注意:如果编译时报:/usr/local/include/zip.h:59:21: fatal error: zipconf.h: No such file or directory 错误,请执行以下操作:

在安装完新版的 libzip 时可能会出现打不到 zipconf.h,手动复制一下
cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h

然后开始编译

./configure –prefix=/usr/local/php –with-config-file-path=/usr/local/php/etc –with-config-file-scan-dir=/usr/local/php/conf.d –enable-fpm –with-fpm-user=www –with-fpm-group=www –enable-mysqlnd –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd –with-iconv-dir –with-freetype-dir=/usr/local/freetype –with-jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr –enable-xml –disable-rpath –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization –with-curl –enable-mbregex –enable-mbstring –enable-intl –enable-pcntl –enable-ftp –with-gd –with-openssl –with-mhash –enable-pcntl –enable-sockets –with-xmlrpc –enable-zip –enable-soap –with-gettext –enable-opcache –with-xsl

配置:
mkdir -p /usr/local/php/etc/
touch /usr/local/php/etc/php-fpm.conf
cp /etc/php-fpm.conf /usr/local/php/etc/php-fpm.conf

mkdir -p /usr/local/php/etc/php-fpm.d/
touch /usr/local/php/etc/php-fpm.d/www.conf
cp /etc/php-fpm.d/www.conf /usr/local/php/etc/php-fpm.d/www.conf

mkdir -p /etc/init.d
touch /etc/init.d/php-fpm
cp /usr/src/php-7.2.3/sapi/fpm/init.d.php-fpm.in /etc/init.d/php-fpm

然后就可以用以下命令进行php-fpm操作
service php-fpm start
查看php-fpm进程
ps aux | grep php-fpm


本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:centos7安装php7.3.5踩坑
喜欢 (0)

您必须 登录 才能发表评论!