本机已经安装了mysql。
下载php7.3.8 https://www.php.net/distributions/php-7.3.8.tar.gz
下载wordpresshttps://wordpress.org/latest.tar.gz
安装php
解压到/usr/local下,重命名为php738
tar -zxvf php-7.3.8.tar.gz
mv php-7.3.8/ php738
进入php目录php738安装,
执行命令
./configure --enable-fpm --prefix=/usr/local/php738 --with-config-file-path=/usr/local/php7.3/etc --with-apxs2=/usr/local/apache/bin/apxs --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-openssl --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-xml --enable-zip
报错
Configuring SAPI modules
checking for Apache 2.0 handler-module support via DSO through APXS...
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
那么,先安装perl
yum install perl
安装httpd-devel
yum install httpd-devel
查询apxs路径
find / -name apxs
找到路径是/usr/bin/apxs,那么指定路径执行命令
./configure --enable-fpm --prefix=/usr/local/php738 --with-config-file-path=/usr/local/php7.3/etc --with-apxs2=/usr/local/apache/bin/apxs --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-openssl --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-xml --enable-zip --with-apxs2=/usr/bin/apxs
报错
checking for pkg-config... /usr/bin/pkg-config
configure: error: libxml2 not found. Please check your libxml2 installation.
那么,安装libxml2-devel
yum install libxml2-devel
继续执行命令
./configure --enable-fpm --prefix=/usr/local/php738 --with-config-file-path=/usr/local/php7.3/etc --with-apxs2=/usr/local/apache/bin/apxs --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-openssl --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-xml --enable-zip --with-apxs2=/usr/bin/apxs
报错
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>
说是没找到openssl,但是我本机执行了下命令,发现是安装了openssl
[root@jiba php738]# openssl
OpenSSL>
[root@jiba files]# whereis openssl
openssl: /usr/bin/openssl /usr/lib64/openssl /usr/share/man/man1/openssl.1ssl.gz
那么再执行configure命令式,增加连接
--with-openssl-dir=/usr/bin/openssl/
执行
./configure --enable-fpm --prefix=/usr/local/php738 --with-config-file-path=/usr/local/php7.3/etc --with-apxs2=/usr/local/apache/bin/apxs --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerbe