centos6.9 PHP的编译安装并连接nginx
1.安装yum -y install libxml2-devel openssl-devel bzip2-devel libmcrypt-devel 解决php包的依赖关系,可能libmcrypt会报错,先执行yum install epel-release,再重新安装一下就可以了。

2.下载PHP安装包并且上传到服务器,解压,(或者可以用wget直接下载到服务器)。

3.在PHP包的位置编译php:
./configure \
--prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--enable-fpm --with-fpm-user=www \
--with-fpm-group=www \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir=/usr \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-mbstring \
--with-mcrypt \
--enable-ftp \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--without-pear \
--with-gettext \
--disable-fileinfo \
--enable-maintainer-zts

4.make && make install

5.复制相关配置文件到相关位置上:
cp php.ini-production /usr/local/php/etc/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm



6.加权限并设置开机启动php


7.开启php服务:
/usr/local/php/sbin/php-fpm或者 /etc/init.d/php-fpm start

8.查看php是否启动成功:
netstat -lnt |grep 9000

9.建一个存放nginx的网站根目录:
mkdir -p /tmp/www/zabbixserver.com


10.在nginx.cong配置文件中的http模块加上一条命令:
include /usr/local/nginx/conf/vhost/*.conf ;

11.根据“ include /usr/local/nginx/conf/vhost/*.conf ”在相对应的位置添加文件


12.把相关配置贴进去:
server
{
listen 80; #(不要与nginx.conf的端口冲突了)
server_name zabbixserver.com;
access_log /usr/local/nginx/logs/zabbixserver.com.access.log ;
index index.html index.htm index.php;
root /tmp/www/zabbixserver.com;
charset utf-8;
expires 2h;
location ~ .*\.(php)?$ {
expires -1s;
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
}

13.测试是否成功
cd /usr/local/nginx/sbin
./nginx -t

14.重启nginx服务
./nginx -s reload



centos6.9 PHP的编译安装并连接nginx的更多相关文章
- Centos6下Python3的编译安装
本文转载自 Centos6下Python3的编译安装 系统环境:CentOS 6.8-Minimal 安装Python依赖包: 1 [root@Python src]# yum install zli ...
- 在CentOS6.7操作系统上编译安装httpd2.4
功能描述: 在CentOS6.7操作系统上,编译安装apache服务,实现定制功能等 一.安装前提 1)安装编译httpd需要的软件包 [root@bqe6tewv41kx ~]# yum -y i ...
- Centos6.5 源码编译安装 Mysql5.7.11及配置
安装环境 Linux(CentOS6.5 版).boost_1_59_0.tar.gz.mysql-5.7.11.tar.gzMySQL 5.7主要特性: 更好的性能:对于多核CPU.固态硬盘. ...
- centos6.8服务器配置之编译安装PHP、配置nginx
php version 5.6.31.nginx version: nginx/1.10.2 1.下载: wget http://cn2.php.net/distributions/php-5.6.3 ...
- 在CentOS6.7操作系统上编译安装mysql-5.6.31
功能概述: 由于在centos 6.7下通过yum安装的mysql是5.1版本的,不满足需求,因此经常性需要编译安装mysql服务等. 一.安装mysql 1.安装前提 1)安装编译mysql代码所依 ...
- Centos6.5源码编译安装nginx
1.安装pcre下载地址:http://jaist.dl.sourceforge.net/project/pcre/pcre/8.38/pcre-8.38.tar.gz #tar -axvf pcre ...
- centos6.5生产环境编译安装nginx-1.11.3并增加第三方模块ngx_cache_purge、nginx_upstream_check、ngx_devel_kit、lua-nginx
1.安装依赖包 yum install -y gcc gcc-c++ pcre-devel openssl-devel geoip-devel 2.下载需要的安装包 LuaJIT-2.0.4.zip ...
- 编译安装php、nginx
以centos6.6为例 1.安装以及配置php 首先在官网下载源码包http://php.net/downloads.php 这里下载php-7.1.16 .tar.gzcd php-7.1.16 ...
- 如何源码编译安装并控制nginx
安装nginx 注意 Linux操作系统需要2.6及其以上的内核(支持epoll) 使用nginx的必备软件 gcc编辑器 yum -y install gcc gcc-c++ pcre库(支持正则表 ...
随机推荐
- SSIS - 2.使用脚本任务弹出对话框
步骤如下: 1.打开Visual Studio 2012或者SSDT工具->单击“文件”->选择"新建"打开创建新工程的对话框如下: 2.在"Business ...
- day29 二十九、元类、单例
一.eval.exec内置函数 1.eval函数 eval内置函数的使用场景: ①执行字符串会得到相应的执行结果 ②一般用于类型转换得到dict.list.tuple等 2.exec函数 exec应用 ...
- 利用GCD 中的 dispatch_source_timer 给tableViewCell添加动态刷新的计时/倒计时功能
1.思路一(失败) 在设置好cell 里的内容之后在每个cell 返回时调用定时器事件,更新cell 内容,然后刷新整个表格. - (void)didadida:(UITableViewCell *) ...
- Docker 实战(二)——centos7镜像安装nginx,将安装nginx的centos容器生成新的镜像,并导出
Docker centos7镜像安装nginx 1.安装docker 使用yum安装docker不再重复:见 Linux常用命令 2.pull centos 1)在docker仓库中搜索centos ...
- Linux-centos7下python3 环境设置
首先安装依赖包 yum -y groupinstall "Development tools" yum -y install zlib-devel bzip2-devel open ...
- 我喜欢的几款不错的vim插件
插件安装组件 https://github.com/tpope/vim-pathogen supertab自动补齐 https://www.vim.org/scripts/script.php?scr ...
- leetcode 之 Two Sum II - Input array is sorted c++
class Solution { public: vector<int> twoSum(vector<int>& numbers, int target) { int ...
- 意外的php之学习笔记
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/gc_gongchao/article/details/37312039 什么是php? ph ...
- 浏览器User-Agent大全
what's the User-Agent UserAgent中文名为用户代理,是Http协议中的一部分,属于头域的组成部分,UserAgent也简称UA.它是一个特殊字符串头,是一种向访问网站提供你 ...
- 解析key值不确定的json数据
遇到一个奇葩的需求,一段json的key值是动态的,并且这个key还是有作用的.这就要求在不知道key是多少的情况下去把这段json解析出来. 我用到的方法是迭代器.具体代码如下 JSONObject ...