下载并解压php7源码包:
https://www.php.net/downloads.php
2. 文件php-7.3.8.tar.gz放在/usr/local/src
3. tar -zxvf /usr/local/src/php-7.3.8.tar
4. mkdir /usr/local/zwk_php
mv /usr/local/src/php-7.3.8 /usr/local/zwk-php
5. cd /usr/local/zwk-php
./configure --prefix=/usr/local/zwk_php --with-apxs2=/usr/local/zwk_apache/httpd-2.4.41/bin/apxs --with-config-file-path=/usr/local/zwk_php/etc --with-mysql=/usr/local/zwk_mysql --with-pdo-mysql=/usr/local/zwk_mysql --with-mysqli=/usr/local/zwk_mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif
在上一步编译PHP的过程中,我遇到了这些错误:
configure: error: xml2-config not found. Please check your libxml2 installation.
安装所需的包然后继续编译:
yum install -y libxml2-devel
configure: error: Cannot find OpenSSL’s <evp.h>
安装所需的包然后继续编译:
yum install -y openssl openssl-devel
configure: error: Please reinstall the BZip2 distribution
安装所需的包然后继续编译:
yum install -y bzip2 bzip2-devel
configure: error: jpeglib.h not found.
安装所需的包然后继续编译:
yum install -y libpng libpng-devel
configure: error: freetype-config not found.
安装所需的包然后继续编译:
yum install -y freetype freetype-devel
configure: error: mcrypt.h not found. Please reinstall libmcry