centos7安装php7.3.6记录

./configure –prefix=/opt/software/php-7.3.6 –sysconfdir=/opt/software/php-7.3.6/etc –with-config-file-scan-dir=/opt/software/php-7.3.6/etc/ini –enable-fpm –with-fpm-user= –with-fpm-group= –enable-mysqlnd –with-mysqli=mysqlnd –with-pdo-mysql=mysqlnd –enable-mysqlnd-compression-support –with-iconv-dir –with-freetype-dir –with-jpeg-dir –with-png-dir –with-zlib –with-zlib-dir –enable-libxml –with-libxml-dir –enable-xml –disable-rpath –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization –with-curl –enable-mbregex –enable-mbstring –enable-intl –enable-ftp –with-gd –enable-gd-jis-conv –with-openssl –with-mhash –enable-pcntl –enable-sockets –with-xmlrpc –enable-zip –enable-soap –with-gettext –disable-fileinfo –enable-opcache=no –with-pear –enable-maintainer-zts –with-ldap=shared –enable-pdo –enable-sysvshm –with-xpm-dir –enable-session –enable-ctype –without-gdbm

报错

configure: error: Please reinstall the libzip distribution

1
2
3
4
5
6
#下载编译安装
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

报错

configure: error: off_t undefined; check your library configuration

1
2
3
4
5
6
7
8
#添加搜索路径到配置文件
echo '/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'>>/etc/ld.so.conf

#然后 更新配置
ldconfig -v

make: *** [ext/zip/php_zip.lo] 错误 1

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

添加配置文件

cp php-fpm.conf.default php-fpm.conf
sudo cp ~/php-7.3.6/php.ini-production ./lib/php.ini

扩展目录

/opt/software/php-7.3.6/lib/php/extensions/no-debug-zts-20180731/