lnmp 环境 ,php 和nginx 安装在一个机器上,mysql 是单独的服务器。
安装 php7.3
下载
wget https://downloads.php.net/~cmb/php-7.3.0beta1.tar.gz
tar -zxvf php-7.3.0beta1.tar.gz
useradd -s /sbin/nologin php-fpm
编译
./configure --prefix=/usr/local/php --with-curl --with-freetype-dir
–with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-zip --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm
报错:1,
**configure: error: system libzip must be upgraded to version >=**0.11。
使用Yum最新版只到0.10,不足以达到要求。
一、先删除libzip
yum remove libzip -y
SSH执行以上命令,先删除libzip 和 libzip-devel
二、下载安装并手动编译
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
三、(可忽略)另外最新版本请参考官网:https://nih.at/libzip/ 1.5.0的libzip需要cmake
wget https://libzip.org/download/libzip-1.5.0.tar.gz
tar -zxvf libzip-*
cd libzip*
mkdir build && cd build && cmake .. && make && make install
报错2:
error: off_t undefined; check your library configuration
根据报错信息分析 configure: error: off_t undefined; check your library configuration
未定义的类型 off_t。
off_t 类型是在 头文件 unistd.h中定义的,在32位系统 编程成 long int ,64位系统则编译成 long long int ,这里题主的系统应该是 64位的吧,在进行编译的时候 是默认查找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
再次执行 编译 成功