自己的测试服务器,Centos7系统,Apache2.4是使用yum安装的。mariadb也是yum安装的。php5.6是自己手动编译安装的,也安装成功了,输入php -v
可以看到版本信息。
问题是现在Apache无法解析php文件。查了一些资料,有的说要在编译php的到时候指明
--with-apxs2=/usr/local/apache/bin/apxs
但是在编译php时我没有加上这条命令。而且我没有找到apxs2的路径。
现在只能重新手动安装php吗?网上的很多资料都是直接yum安装的,但是yum搭建的LAMP环境,版本都太低了。 **我只能手动安装**
以下是我编译时使用的配置:
./configure \
--prefix=/usr/local/php7 \
--with-fpm-user=apache \
--with-fpm-group=apache \
--with-bz2 \
--with-curl \
--with-gd \
--with-openssl \
--with-mhash \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-iconv-dir=/usr/local/libiconv \
--with-gettext \
--with-libxml-dir \
--with-zlib \
--with-xmlrpc \
--with-pcre-regex \
--with-pear \
--with-pdo-mysql=mysqlnd \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-libdir=lib64 \
--enable-dom \
--enable-xml \
--enable-fpm \
--enable-bcmath \
--enable-ftp \
--enable-sockets \
--disable-ipv6 \
--enable-mbregex \
--enable-mbstring \
--enable-calendar \
--enable-gd-native-ttf \
--enable-static \
--enable-fpm \
--enable-bcmath \
--enable-libxml \
--enable-inline-optimization \
--enable-mbregex \
--enable-opcache \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvsem \
--enable-zip \
Apache需要安装mod_php吧?然后在配置文件时LoadModule。