centos6.5编译安装php7,及配置与nginx通信。
一、配置编译环境
yum update && yum upgrade
yum groupinstall "Development Tools"
yum install gcc gcc-c++ pcre* openssl* gd-devel* zlib-devel pcre-devel libxml2-devel curl-devel
二、下载安装libmcrypt(yum包中没有libmcrypt依赖包,所以需要单独编译安装)
wget https://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
tar -zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make && make install
编辑 /etc/ld.so.conf 末行添加 /usr/local/lib 并执行:ldconfig
三、下载php7压缩包
wget http://cn2.php.net/distributions/php-7.0.1.tar.gz
tar zxvf php-7.0.1.tar.gz
四、编译配置
./configure \
--prefix=/usr/local/php7 \ [php安装路径]
--exec-prefix=/usr/local/php7 \
--bindir=/usr/local/php7/bin \
--sbindir=/usr/local/php7/sbin \
--includedir=/usr/local/php7/include \
--libdir=/usr/local/php7/lib/php \
--mandir=/usr/local/php7/php/man \
--with-config-file-path=/usr/local/php7/etc \
--with-mcrypt=/usr/include \
--with-mhash \
--with-openssl \
--with-mysqli=shared,mysqlnd \
--with-pdo-mysql=shared,mysqlnd \
--with-gd \
--with-iconv \
--with-zlib \
--enable-zip \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-xml \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-mbregex \
--enable-mbstring \
--enable-ftp \
--enable-gd-native-ttf \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--without-pear \
--with-gettext \
--enable-session \
--with-curl \
--with-jpeg-dir \
--with-freetype-dir \
--enable-opcache \
--enable-fpm \
--without-gdbm \
--disable-fileinfo
配置成功
Generating files
configure: creating ./config.status
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+--------------------------------------------------------------------+ Thank you for using PHP. config.status: creating php7.spec
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/fpm/php-fpm.conf
config.status: creating sapi/fpm/www.conf
config.status: creating sapi/fpm/init.d.php-fpm
config.status: creating sapi/fpm/php-fpm.service
config.status: creating sapi/fpm/php-fpm.8
config.status: creating sapi/fpm/status.html
config.status: creating sapi/cgi/php-cgi.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: executing default commands
五、安装编译
make && make install
六、配置文件
cp /usr/local/php7/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf
七、启动php-fpm
/usr/local/php7/sbin/php-fpm
八、配置nginx.conf与php-fpm通信(nginx的编译安装:http://www.cnblogs.com/yxhblogs/p/7489925.html)
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ .php$ {
root html;//web根目录
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;//注意该行配置
include fastcgi_params;
}
九、创建php测试文件
在/usr/local/nginx/html下创建phpinfo.php文件
在浏览器中访问
centos6.5编译安装php7,及配置与nginx通信。的更多相关文章
- Centos6.10编译安装php-7.1.12并安装redis模块
1.服务器初始化 yum update -yyum install epel-release -yyum install gcc gcc-c++ wget lsof lrzsz telnet -y 2 ...
- CentOS7编译安装php7.1配置教程详解
这篇文章主要介绍CentOS7编译安装php7.1的过程和配置详解,亲测 ,需要的朋友可以参考. 1.首先安装依赖包: yum install libxml2 libxml2-devel openss ...
- centos6.5编译安装php7
1.安装依赖软件库: yum install -y libxml2-devel libtool* curl-devel libjpeg-devel libpng-devel freetype-deve ...
- Centos 7下编译安装PHP7.2(与Nginx搭配的安装方式)
一.下载源码包 百度云网盘下载地址:https://pan.baidu.com/s/1li4oD3qjvFyIaEZQt2NVRg 提取码:4yde 二.安装php依赖组件 yum -y instal ...
- nginx php-fpm安装配置 CentOS编译安装php7.2
CentOS编译安装php7.2 介绍: 久闻php7的速度以及性能那可是比php5系列的任何一版本都要快,具体性能有多好,建议还是先尝试下再说.如果你是升级或新安装,那你首先需要考虑php7和程序是 ...
- centos7.6环境编译安装php-7.2.24修复最新 CVE-2019-11043 漏洞
先编译安装php-7.2.24,然后编译安装扩展 主版本地址地址:https://www.php.net/distributions/php-7.2.24.tar.gz # 编译 php-7.2.24 ...
- 【安装PHP】如何在openSUSE42.1下编译安装PHP7
首先推荐一篇文章PHP 7 Release Date Arrived: Will Developers Adopt PHP 7? - PHP Classes blog. 里面说到是否会去使用PHP7, ...
- CentOS6.3编译安装Memcached
要用到如下源码包: /usr/local/src/memcached/libevent-2.0.21-stable.tar.gz /usr/local/src/memcached/memcached- ...
- CentOS6.3编译安装Memcached的PHP客户端memcache
在安装Memcached的PHP客户端memcache之前,可先看下先前的工作笔记: PHP5不重新编译,如何安装自带的未安装过的扩展,如soap扩展? 安装PHP的memcache扩展 cd /us ...
随机推荐
- 九度OJ 1152:点菜问题 (01背包、DP)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:1046 解决:543 题目描述: 北大网络实验室经常有活动需要叫外买,但是每次叫外买的报销经费的总额最大为C元,有N种菜可以点,经过长时间的 ...
- php调用短网址接口
<?php $ch=curl_init(); curl_setopt($ch,CURLOPT_URL,"http://dwz.cn/create.php"); curl_se ...
- CentOS7的/tmp目录自动清理规则(转)
CentOS7的/tmp目录自动清理规则 CentOS6以下系统(含)使用watchtmp + cron来实现定时清理临时文件的效果,这点在CentOS7发生了变化,在CentOS7下,系统使用sys ...
- 在RedHat Linux系统中安装和配置snmp服务
检查系统是否安装snmp服务 # rpm -qa|grep snmp net-snmp-5.3.2.2-17.el5 net-snmp-perl-5.3.2.2-17.el5 net-snmp-dev ...
- Halcon下载、安装
下载地址: 官网:http://www.halcon.com/halcon/download/ Halcon学习网:http://www.ihalcon.com/read.php?tid=56 { 最 ...
- (1366, "Incorrect string value: '\\xF3\\xB0\\x84\\xBC</...' for column 'content' at row 1")
插数据库报错 (1366, "Incorrect string value: '\\xF3\\xB0\\x84\\xBC</...' for column 'content' at r ...
- DataGridView自定义RichTextBox列
https://www.codeproject.com/Articles/31823/RichTextBox-Cell-in-a-DataGridView-2 RichText是用图片显示的,当Sel ...
- c# CODE REVIEW (13-11 TO 14-01)
一. 松耦合
- win 10 安装.msi 程序出现the error code is 2503
解决方法: C:\Windows\temp文件夹的权限不够,需要给其更高权限 右键temp文件夹 点击属性进入属性对话框 组或用户名的里面的All APPLICATION PACKAGES和所有受限制 ...
- Python成长之路第一篇(2)__初识列表和元组
可以将列表和元组当成普通的“数组”,他能保存任意数量任意类型的Python对象,和数组一样都是通过数字0索引访问元素,列表和元组可以存储不同类型的对象,列表和元组有几处重要区别.列表元素用([])包括 ...