如何验证php7安装成功_php 7 编译安装

安装需要的依赖:yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel \

freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel \

glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs \

e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap \

openldap-devel nss_ldap openldap-clients openldap-servers pcre-devel libxslt \

libxslt-devel  libtool-ltdl libtool-ltdl-devel

wget http://au1.php.net/get/php-7.0.1.tar.gz/from/this/mirror

./configure --prefix=/usr/local/php_7.0.1 --with-config-file-path=/usr/local/php_7.0.1/etc  --with-mysqli --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --without-pear --with-zlib --enable-pdo --with-pdo-mysql   --with-apxs2

改apache配置文件内模块为libphp7.sovim /etc/httpd/conf/httpd.conf

LoadModule php7_module        /usr/lib64/httpd/modules/libphp7.so

增加一行解析

/etc/httpd/conf.d/php.conf

AddType application/x-httpd-php-source .phps

验证php 版本:<?php

phpinfo();

?>

遇到问题:

with-apx2 checking for Apache 2.0 handler-module support via DSO through

yum install httpd-devel

php configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no

export LD_LIBRARY_PATH=/lib/:/usr/lib/:/usr/local/lib

如下是编译apache, 如果自己编译的话

wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz

tar -zxvf libmcrypt-2.5.7.tar.gz

cd libmcrypt-2.5.7

./configure

make

make install

cd ..

wget http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz

tar -zxf apr-1.5.2.tar.gz

cd apr-1.5.2

./configure --prefix=/usr/local/apr

make -j18  && make install

cd ..

wget http://archive.apache.org/dist/apr/apr-util-1.5.3.tar.gz

tar -zxf apr-util-1.5.3.tar.gz

cd apr-util-1.5.3

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr

make -j18 && make install

cd ..wget http://mirrors.noc.im/apache//httpd/httpd-2.4.18.tar.gz

tar xzf httpd-2.4.18.tar.gz

cd httpd-2.4.18

./configure --prefix=/usr/local/apache_2.4.18 \

--with-apr=/usr/local/apr \

--with-apr-util=/usr/local/apr-util

make -j18 && make install

这个编译的话,最好在php 前面,然后--with-apx2=/youPath/bin/apx2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值