当前位置首页 > CentOS知识

centos7编译安装php7

阅读次数:229 次  来源:admin  发布时间:

0.下载php源代码

http://www.php.net/releases/

1.配置编译环境

yum install -y gcc gcc++ libxml2-devel openssl openssl-devel

2.设置安装目录

apache

./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/apache2/bin/apxs --enable-fpm --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-curl=/usr/local/curl

普通安装

./configure --prefix=/usr/local/php7 --enable-fpm --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-curl=/usr/local/curl

3.编译安装

make

make install

4.问题

virtual memory exhausted: Cannot allocate memory

虚内存已耗尽:无法分配内存

--disable-fileinfo

5.配置apache

确认是否有一下内容

LoadModule php7_module modules/libphp7.so

找到

lt;FilesMatch "^\.ht">

Order allow,deny

Deny from all

Satisfy All

lt;/FilesMatch>

更改如下

lt;FilesMatch "\.ph(p[2-6]?|tml)$">

SetHandler application/x-httpd-ph

Satisfy All

lt;/FilesMatch>

更改ServerName

ServerName www.wangshuyi.cn:80

上一篇:linux下安装Trac
下一篇:centos编译安装Apache