下载
https://www.php.net/downloads.php
如果Chain慢的话,可以选择其他渠道。
配置
#查看安装命令
php -i | grep configure
#Configure Command => './configure' '--prefix=/home/work/odp/php7' '--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-xmlrpc' '--with-xsl' '--with-zlib' '--enable-fpm' '--enable-bcmath' '--enable-libxml' '--enable-inline-optimization' '--enable-gd-native-ttf' '--enable-mbregex' '--enable-mbstring' '--enable-opcache' '--enable-pcntl' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvsem' '--enable-xml' '--enable-zip'
安装
./configure \
--prefix=/home/work/odp/php72 \
--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-xmlrpc \
--with-xsl \
--with-zlib \
--enable-fpm \
--enable-bcmath \
--enable-libxml \
--enable-inline-optimization \
--enable-gd-native-ttf \
--enable-mbregex \
--enable-mbstring \
--enable-opcache \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvsem \
--enable-xml \
--enable-zip
检查过程中遇到几个问题:
libxml2
configure: error: xml2-config not found. Please check your libxml2 installation.
解决
yum install libxml2
yum install libxml2-devel -y
OpenSSL’s
报错
Cannot find OpenSSL's <evp.h>
解决
yum install -y openssl openssl-devel
CURL
报错
configure: error: cURL version 7.10.5 or later is required to compile php with cURL support
解决
yum install curl-devel
png
报错
configure: error: png.h not found
解决
yum install libpng -y
yum install libpng-devel -y
freetype
报错
configure: error: freetype.h not found.
解决
yum -y install freetype-devel
xslt-config
问题
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
解决
yum -y install libxslt libxslt-devel
安装
make && make install
本文提供了一套详细的PHP安装步骤,包括从官方渠道下载源码包、配置安装参数以及解决安装过程中可能遇到的问题,如缺失依赖库等。
346

被折叠的 条评论
为什么被折叠?



