编译PHP7.3.7
报错configure: error: off_t undefined; check your library configuration
解决方案:
添加搜索路径到配置文件
echo '/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'>>/etc/ld.so.conf
ldconfig -v
更新配置
报错configure: error: Please reinstall the libzip distributio 或 configure: error: system libzip must be upgraded to version >= 0.11。
解决方案:
yum remove libzip -y
wget https://nih.at/libzip/libzip-1.2.0.tar.gz
tar -zxvf libzip-1.2.0.tar.gz
cd libzip-1.2.0
./configure
make && make install
cmake 和 cmake3都要安装
yum install -y cmake
yum install -y cmake3
wget https://libzip.org/download/libzip-1.5.0.tar.gz
tar -zxvf libzip-1.5*
cd libzip-1.5*
mkdir build
cd build
cmake3 .. && make && make install
报错/usr/local/include/zip.h:59:21: fatal error: zipconf.h: No such file or directory
解决方案:
cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h
报错/package/php-7.3.7/ext/zip/php_zip.c:3318:48: error: ‘LIBZIP_VERSION’ undeclared (first use in this function)
解决方案:
重新正确安装 libzip
配置php-fpm
cp php.ini-production /usr/local/php/conf/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
将php-fpm加入启动服务
cp sapi/fpm/php-fpm.service /usr/lib/systemd/system/php-fpm.service
]
启动php-fpm
systemctl start php-fpm.service