0x001 前言
在Centos7.6安装php7.3中遇到了很多很多前所未有的问题,于是我通过百度整理一下常见问题,及处理方案,如有不对,请留言指示!感谢!
0x002 问题及处理方案
(1)、解决configure: WARNING: You will need re2c 0.13.4 or later
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.、
解决方案
wget https://sourceforge.net/projects/re2c/files/0.16/re2c-0.16.tar.gz
tar zxf re2c-0.16.tar.gz && cd re2c-0.16
./configure
make && make install
(2)、解决找不到 zipconf.h
/usr/local/include/zip.h:59:21: fatal error: zipconf.h: No such file or dire
解决方案
#解决方法:手动复制过去
cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h
(3)、编译错误,解决依赖
configure: error: libxml2 not found. Please check your libxml2 installation.
1 | yum install -y libxml2-devel |
configure: error: Please reinstall the BZip2 distribution
1 | yum install -y bzip2-devel |
configure: error: cURL version 7.15.5 or later is required to compile php with cURL support
1 | yum install -y curl-devel |
configure: error: jpeglib.h not found.
1 | yum install -y libjpeg-devel |
configure: error: png.h not found.
1 | yum install -y libpng-devel |
configure: error: freetype-config not found.
1 | yum install -y freetype-devel |
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
1 | yum install -y libxslt-devel |
configure: error: Please reinstall the libzip distribution
1 | yum install -y libzip-devel |
checking for libzip... configure: error: system libzip must be upgraded to version >= 0.11
#先删除旧版本 yum remove -y libzip #下载编译安装 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 |
off_t undefined 报错
checking libzip... yes checking for the location of zlib... /usr checking for pkg-config... (cached) /usr/bin/pkg-config checking for libzip... in default path: found in /usr/local checking for zip_open in -lzip... yes checking for zip_file_set_encryption in -lzip... yes checking for zip_libzip_version in -lzip... no checking stdbool.h usability... yes checking stdbool.h presence... yes checking for stdbool.h... yes checking fts.h usability... yes checking fts.h presence... yes checking for fts.h... yes checking for int8_t... (cached) yes checking for int16_t... (cached) yes checking for int32_t... (cached) yes checking for int64_t... (cached) yes checking for uint8_t... (cached) yes checking for uint16_t... (cached) yes checking for uint32_t... (cached) yes checking for uint64_t... (cached) yes checking for ssize_t... yes checking size of short... (cached) 2 checking size of int... (cached) 4 checking size of long... (cached) 8 checking size of long long... (cached) 8 checking size of off_t... 0 configure: error: off_t undefined; check your library configuration |
off_t 类型是在 头文件 unistd.h中定义的,
在32位系统 编程成 long int ,64位系统则编译成 long long int ,
在进行编译的时候 是默认查找64位的动态链接库,
但是默认情况下 centos 的动态链接库配置文件/etc/ld.so.conf里并没有加入搜索路径,
这个时候需要将 /usr/local/lib64 /usr/lib64 这些针对64位的库文件路径加进去。
#添加搜索路径到配置文件 echo '/usr/local/lib64/usr/local/lib/usr/lib/usr/lib64'>> /etc/ld.so.conf #然后 更新配置ldconfig -v |
安装过程中报错
1 | make && make install |
报错
usr/local/include/zip.h:59:21: fatal error: zipconf.h: No such file or directory
1 | cp /usr/local/lib/libzip/ include /zipconf.h /usr/local/ include /zipconf.h |
(4)、PHP7.3缺少ZIP
cd /www/server/php/73/src/ext/zip/
/www/server/php/73/bin/phpize
./configure --with-php-config=/www/server/php/73/bin/php-config
make && make install
然后,把以前从PHP配置文件里删去的第 1298 行加回来,即在配置文件中加回以下文字:
extension = zip.so
(5)、PHP最大表单提交限制max_input_vars
在php.ini里搜索 max_input_vars ,
就直接更改 max_input_vars ,例如: max_input_vars = 5000,
Comments NOTHING