编译安装php7.3遇到的坑

  1. configure: error: off_t undefined; check your library configuration
  2. configure: error: Please reinstall the libzip distributio
  3. fatal error: zipconf.h: No such file or directory
  4. error: 'LIBZIP_VERSION' undeclared

1. 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

2. configure: error: Please reinstall the libzip distributio

解决:重新安装libzip

yum remove libzip -y
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

3. fatal error: zipconf.h: No such file or directory

解决:执行下面命令

cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h

4. error: 'LIBZIP_VERSION' undeclared

解决:重新安装libzip(老夫使用1.5.2成功了)

wget https://libzip.org/download/libzip-1.5.2.tar.gz
tar -zxvf libzip-1.5.2.tar.gz
cd libzip-1.5.2
mkdir build && cd build && cmake3 .. && make && make install
# 不继续去编译php,如果报错3,可将libzip-1.5.2/build/zipconf.h 拷贝到/usr/local/include下重试

祝你成功!

你可能感兴趣的:(编译安装php7.3遇到的坑)