apache关联php5.6,Centos 7 下Apache2.4关联php5.6.10

准备文件:

17c5d71f1d5b11e6a8252e667288453b.png

上传到服务器,保存到usr/local/bin/soft/php_linux/php-5.6.10.tar.bz2

1,安装步骤:

1.1解压

# tar jxvf php-5.6.10.tar.bz2

1.2配置

#./configure –prefix=/work/installed/php –with-apxs2=/work/installed/apache/bin/apxs –with-config-file-path=/usr/local/php –enable-xml –disable-rpath –enable-bcmath –enable-shmop –enable-sysvsem –enable-inline-optimization –with-curl –enable-mbregex –enable-fpm –enable-mbstring –with-gd –enable-gd-native-ttf –with-openssl –with-mhash –enable-pcntl –enable-sockets –with-xmlrpc –enable-zip –enable-soap –enable-opcache –with-pdo-mysql –enable-maintainer-zts

在配置中可能会出现以下错误:

“configure: error: xml2-config not found. Please check your libxml2 installation.”

“configure: error: Cannot find OpenSSL's”

“checking for cURL in default path... not found

configure: error: Please reinstall the libcurl distribution -

easy.h should be in /include/curl/”

“checking for the location of libjpeg... no

checking for the location of libpng... no

checking for the location of libXpm... no

checking for FreeType 2... no

checking for T1lib support... no

checking whether to enable truetype string function in GD... yes

checking whether to enable JIS-mapped Japanese font support in GD... no

If configure fails try --with-vpx-dir=

If configure fails try --with-jpeg-dir=

configure: error: png.h not found.”

是因为缺少依赖包,执行以下命令即可:

#yum install libxml2 libxml2-devel

#yum install openssl openssl-devel

#yum install curl curl-devel

#yum install libjpeg libjpeg-devel libpng libpng-devel

安装完成后可以:

#make

#make install

2.修改apache2.4的httpd.conf

将DirectoryIndex index.html改为DirectoryIndex index.html index.php

并在类似的地方加上AddType application/x-httpd-php .php

保存退出。

重启服务器

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值