一.安装php依赖库

ftp://xmlsoft.org/libxml2/libxml2-2.9.3.tar.gz
yum install python-devel -y
cd /download/
wget -c ftp://xmlsoft.org/libxml2/libxml2-2.9.3.tar.gz
tar xf libxml2-2.9.3.tar.gz -C tmp/
cd tmp/libxml2-2.9.3/
./configure --prefix=/usr/local/services/
make && make install

    

https://curl.haxx.se/download/curl-7.44.0.tar.gz
tar xf curl-7.44.0.tar.gz -C tmp/
cd tmp/curl-7.44.0/
./configure --prefix=/usr/local/services/
make && make install

    

http://www.ijg.org/files/jpegsrc.v9a.tar.gz
tar xf jpegsrc.v9a.tar.gz -C tmp/
cd tmp/jpeg-9a/
./configure --prefix=/usr/local/services/
make && make install

  

ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/libpng-1.6.28.tar.gz
http://download.sourceforge.net/libpng/libpng-1.6.2.tar.gz
tar xf libpng-1.6.2.tar.gz -C tmp/
cd tmp/libpng-1.6.2/
./configure --prefix=/usr/local/services/
make && make install

  

http://download.savannah.gnu.org/releases/freetype/freetype-2.6.5.tar.gz
http://download.chinaunix.net/down.php?id=35028&ResourceID=3295&site=1
tar xf freetype-2.4.3.tar.bz2 -C tmp/
cd tmp/freetype-2.4.3/
./configure --prefix=/usr/local/services/
make && make install

  

https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
http://download.chinaunix.net/down.php?id=45065&ResourceID=5804&site=1
tar xf libevent-2.0.21-stable.tar.gz -C tmp/
cd tmp/libevent-2.0.21-stable/
./configure --prefix=/usr/local/services/ --disable-debug-mode
make && make install

  

https://github.com/skvadrik/re2c/releases/download/0.16/re2c-0.16.tar.gz
http://download.chinaunix.net/down.php?id=45065&ResourceID=5804&site=1
tar xf re2c-0.16.tar.gz -C tmp/
cd tmp/re2c-0.16/
./configure --prefix=/usr/local/services/
make && make install

  

ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
tar xf libmcrypt-2.5.7.tar.gz -C tmp/
cd tmp/libmcrypt-2.5.7/
./configure --prefix=/usr/local/services/
make && make install

    

二.安装php  

wget http://cn2.php.net/distributions/php-5.6.31.tar.gz

  

./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 --with-ldap --disable-fileinfo --enable-maintainer-zts

make && make install

  

  

configure过程中各种糟心,缺少各种xx.h文件或者各种xx未声明,一般都是缺少开发库

yum install libxml2-devel -y
yum install libcurl-devel -y
yum install libjpeg-devel -y
yum install libpng-devel -y
yum install freetype-devel -y yum install libmcrypt* -y
libmcrypt明明已经安装但缺少devel包,centos自带yum和163yum都没有对应包(libmcrypt-devel)下载,epel可以很好的解决这一难题,参考链接: http://www.cnblogs.com/SunnyZhu/p/5420549.html http://www.linuxidc.com/Linux/2015-08/121079.htm
yum install epel-release -y #除了rpm安装,也可yum安装epel
yum install libmctypt-devel -y yum install openldap openldap-devel -y
cp -frp /usr/lib64/libldap* /usr/lib/

  

三.修改php-fpm配置文件

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /download/tmp/php-5.6.31/php.ini-production /usr/local/php/etc/php.ini
vi php-fpm.conf

;listen = 127.0.0.1:9000
listen = /tmp/php-cgi.sock #以socke的方式访问.注视掉.ip端口的方式. ; Default Value: log/php-fpm.log
error_log = /data/php_log/php.error #根据不同的项目名.定义不同的.sock 和日志. # 调整进程数量
pm.max_children:p静态方式下开启的php-fpm进程数量。
pm.start_servers:动态方式下的起始php-fpm进程数量。
pm.min_spare_servers:动态方式下的最小php-fpm进程数量。
pm.max_spare_servers:动态方式下的最大php-fpm进程数量。

  

mkdir /data/php_log

  

尝试访问php页面出错,查看错误日志:
var/log/nginx/error.log报错:
2017/08/04 04:55:58 [crit] 61807#61807: *6 connect() to unix:/tmp/php-cgi.sock failed (13: Permission denied) while connecting to upstream, client: 192.168.119.129, server: localhost, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-cgi.sock:", host: "192.168.119.130" ll /tmp/php-cgi.sock发现属主属组都为root用户,因此错误原因就是:nginx的deamon用户无权限调用该socket与php-fpm通信

   

修改php-fpm配置文件/usr/local/php/etc/php-fpm.conf

使/tmp/php-cgi.sock属主属组为nginx执行用户

user = deamon
group = deamon listen.owner = deamon
listen.group = deamon

    

修改nginx配置文件/usr/local/nginx/conf/nginx.conf

       location ~ \.php$ {
root /www;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

  

启动php

#/usr/local/php/sbin/php-fpm

  

  

  

zabbix准备:php安装的更多相关文章

  1. zabbix 3.0 安装 ubuntu环境

    zabbix 3.0 安装 标签(空格分隔): 开发 [TOC] 下载deb # wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/z ...

  2. zabbix windows angent安装:

    zabbix windows angent安装:1.下载zabbix agent for windows客户端,直接解压到C盘下.C:\zabbix 的目录015/04/21 11:16 <DI ...

  3. Zabbix概念、安装以及快速入门

    Zabbix is an enterprise-class open source distributed monitoring solution.[1] Zabbix是一个企业级的.开源的.分布式的 ...

  4. 【zabbix系列】安装与加入host

    測试环境 Ubuntu 14.04.1 LTS [服务端安装] 关于安装官方提供了非常具体的安装方法,包含各平台的源代码及包安装.关于其它版本号Linux请參考 https://www.zabbix. ...

  5. zabbix源码安装实例

    环境 系统                 Centos7 zabbix版本      Zabbix 3.4.15 (revision 86739) zabbix源码安装 .tar.gz cd zab ...

  6. zabbix学习笔记----安装----2019.03.26

    1.zabbix官方yum源地址:repo.zabbix.com 2.安装zabbix server zabbix server使用mysql作为数据库,在zabbix 3.X版本,安装zabbix- ...

  7. zabbix客户端的安装、zabbix主被动模式、添加主机模板等、处理页面的中文乱码

    1.zabbix客户端的安装: 如下步骤: wget repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch. ...

  8. 运用Zabbix实现内网服务器状态及局域网状况监控(3) —— Zabbix服务端安装

    1. Zabbix服务端安装,基于LNMP PHP5.5+Nginx1.9安装配置:http://www.cnblogs.com/vurtne-lu/p/7707536.html MySQL5.5编译 ...

  9. CentOS7 zabbix服务 简单安装文档

    1. 简介 zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案. zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供灵活的通知机制以让系统管理员快 ...

  10. zabbix v3.0安装部署

    这篇文章没有写明init的部分要注意 zabbix v3.0安装部署 摘要: 本文的安装过程摘自http://www.ttlsa.com/以及http://b.lifec-inc.com ,和站长凉白 ...

随机推荐

  1. yum常用命令大全

    yum命令是在Fedora和RedHat以及SUSE中基于rpm的软件包管理器,它可以使系统管理人员交互和自动化地更细与管理RPM软件包,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性 ...

  2. [Full-stack] 世上最好语言 - PHP

    前言 本篇是对个人PHP, Laravel系列博文的总结与思考. 目的在于理清并熟练如下过程: "需求 --> Usercase --> UI --> 框架 --> ...

  3. [Optimisation] Read & Write file on Hard Disk

    Ref: 探寻C++最快的读取文件的方案 方法/平台/时间(秒) Linux gcc Windows mingw Windows VC2008 scanf 2.010 3.704 3.425 cin ...

  4. SpringBoot-服务端参数验证-JSR-303验证框架

    1. springboot 默认集成了 hibernate-validator,它默认是生效的,可以直接使用. 比如: @RestController @RequestMapping("/h ...

  5. 大杂烩 -- ArrayList的动态增长 源码分析

    基础大杂烩 -- 目录 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 问题:当ArrayList中放入的元素一直增加会如 ...

  6. 延续(continuation)

    首先看下延续的定义: 续延是在运行中被暂停了的程序:即含有计算状态的单个函数型对象.当这个对象被求值时,就会在它上次停下来的地方重新启动之前保存下来的计算 在计算机科学和程序设计领域,延续是计算机程序 ...

  7. ubuntu安装图形界面

    命令行模式的Ubuntu16.04安装图形界面 apt-get update sudo apt-get install xinit sudo apt-get install gdm sudo apt- ...

  8. db2 Reorgchk:重组检查,是否需要重组

    Reorgchk:重组检查,是否需要重组.判断表或索引是否需要重组,有2种方法:1.通过reorgchk工具  reorgchk工具利用8个公式(3个表公式,5个索引公式),如果表统计结果F1,F2或 ...

  9. 通过Rabbitmq从ipone手机传输imu和相机数据到电脑端

    https://github.com/tomas789/iOSmsg_client https://github.com/tomas789/iOSmsg 通过xcode工具把iosmsg打包发布到ip ...

  10. 泡泡一分钟:Automatic Parameter Tuning of Motion Planning Algorithms

    Automatic Parameter Tuning of Motion Planning Algorithms 运动规划算法的自动参数整定 Jos´e Cano, Yiming Yang, Brun ...