阿里云Centos7.2 安装Wrodpress5.2 之 Php 7.3.8环境安装

本机已经安装了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-kerberos --with-libdir=li
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值