centos php php-fpm install
好记性不如烂笔头,把自己安装的步骤记录下来
1、下载php-5.2.8以及php-5.2.8-fpm-0.5.10.diff.gz,放到/usr/local/src目录
2、解压php-5.2.8到/usr/local/src/php-5.2.8
3、php-fpm打补丁
cd /usr/local/src
gzip -cd php-5.2.8-fpm-0.5.10.diff.gz | patch -d php-5.2.8 -p1
4、安装一些必要的东西
1) yum -y install curl curl-devel
2) libmcrypt
wget http://ncu.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz(备注,这个版本安装始终报错,我换成2.5.7的就好,地址ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz)
编译时候报错 :configure: error: C++ compiler cannot create executables(没有安装c++) 解决方案: yum install gcc gcc-c++ gcc-g77
./configure --prefix=/usr/local/libmcrypt
make && make install
3) yum install mysql(只安装客户端,没有安装server端)
编译报错 :Cannot find MySQL header files under yes
解决方案:yum install -y mysql-devel
又报这个错:Cannot find libmysqlclient under /usr 。
通过查找libmysqlclient,发现是在/usr/lib64/mysql/目录内的libmysqlclient.so.16.0.0做的软连接,PHP默认是去的 /usr/lib/搜索,所以没有找到.找到问题了就好解决了.
解决方案1: cp -rp /usr/lib64/mysql/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.so
解决方案2 : 编译时加上 --with-mysql=mysqlnd (未亲自验证 - -)
4、编译php
cd php-5.2.8
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/lbi64/mysql --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-debug --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt-dir=/usr/local/libmcrypt --enable-ftp --with-openssl
结果报错,configure:error:xml2-config not found。 解决方案: yum install libxml2-devel
再次编译,还是报错。undefined reference to `_icon
需要安装iconv,官网文档http://www.gnu.org/software/libiconv/ ,下载安装到/usr/local/libiconv
记得每次重新编译的时候make clean下
再次编译,成功
(注意,有时候还是会出错,
那么./configure … 之后,修改下 Makefile,找到其中的
EXTRA_LIBS = -lcrypt -lz -lcrypt -lrt -lmysqlclient -lmcrypt -lldap -llber -lfreetype -lpng -lz -ljpeg -lcurl -lz -lrt -lm -ldl -lnsl -lrt -lxml2 -lz -lm -lssl - lcrypto -ldl -lz -lcurl -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lidn -lssl -lcrypto -lz -lxml2 -lz -lm -lssl -lcrypto -ldl -lz -lxml2 -lz -lm -lxml2 -lz -lm - lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt
在最后面添加 -liconv
)
make && make install 成功
很奇怪的一点就是竟然没有php.ini,我用php --ini没找到任何的php.ini,但是还是能够正常使用php,看来它是使用的默认配置;好吧,我从网上down了一份放到/usr/local/php/etc目录下
然后稍微的修改下php-fpm.conf , 运行/usr/local/php/sbin/php-fpm start.启动了,可以通过nginx代理访问了,下面会讲下php-fpm的配置
5、php-fpm配置
发现一个诡异的问题,我把 pm.max_children 设置为1024,fpm的错误日志就会不停的报 “WARNING: [pool www] child 9730 exited with code 255 after 0.013489 seconds from start”
而我设置为1000(最新消息,1019也没问题。这尼玛坑爹货)的话就不会报错,这个太诡异了,网上google了半天,有很多人有类似的问题但是都没有解决方法
而且如果是1024的话。service php-fpm stop是不起作用的:
kill -QUIT `cat $php_fpm_PID` 这句命令并不起作用,需要用到#killall -9 php-fpm才能杀掉php-fpm
而如果是1019的话就没问题,这这这这、我也无语了
centos php php-fpm install的更多相关文章
- CentOS 6.6 FTP install
/************************************************************************* * CentOS 6.6 FTP install ...
- CentOS 6.6 nginx install
/************************************************************************* * CentOS 6.6 nginx instal ...
- CentOS 6.6 MySQL install
/************************************************************************* * CentOS 6.6 MySQL instal ...
- Installing Zabbix 3.2 in Centos 6.8 Clean Install Dependencies Errors
ZABBIX Forums > Zabbix Discussions and Feedback > Zabbix Troubleshooting and Problems > Ins ...
- 两台centos,用yum install 安装,一台成功,一台失败
记录一下问题: 两台centos,用yum install 安装软件,一台成功,一台失败 第一步:查看yum源 yum repolist enabled 疑问:centos安装的方法一致,但yum源 ...
- CentOS ./configure && make && make install详解
码的安装一般由3个步骤组成:配置(configure).编译(make).安装(make install). 在Linux中利用源码包安装软件最重要的就是要仔细阅读安装包当中的README INST ...
- 转载--How to Install VMware Tools on CentOS 6.3
源地址:http://www.ehowstuff.com/how-to-install-vmware-tools-on-centos-6-3/ VMware Tools is a group of u ...
- How to install 64-bit Google Chrome 28+ on 64-bit RHEL/CentOS 6 or 7
How to install 64-bit Google Chrome 28+ on 64-bit RHEL/CentOS 6 or 7 The problem Google developers s ...
- How to Install Apache Tomcat 8.5 on CentOS 7.3
How to Install Apache Tomcat 8.5 on CentOS 7.3 From: https://www.howtoforge.com/tutorial/how-to-inst ...
- centos source install
CentOS Kernel Source Install Mar 12th, 2012 | Comments CentOS kernel source install, first off if yo ...
随机推荐
- 关于在c#中引用外部dll文件,在页面中找不到命名空间
最近在项目中碰到这样的问题,经过搜索,发现是vs2010的版本不对,VS默认的版本是.NET Framework 4 Client Profile,需要将他更改为.NET Framework 4 版本 ...
- grep/awk/sed 或者 并且 否定
Grep 'OR' Operator Find all the lines in a file, that match any of the following patterns. Using GRE ...
- C# WebBrowser 设置代理完全解决方案
微软webbrowser控件也就是IE插件,他的所有功能就像IE类似,当然设置也是一样的,下面介绍下webbrowser如何设置代理,可不要用这个对抗广告联盟哦 You can change the ...
- 等额本息Vs等额本金
1:贷款种类一旦选择不能改变.2:你提前还款的全部属于本金部分,若能一次性归还本金只需付清当月月息即可[不按年利率计算而是月利率],与你归还的本金违约金[设:提前还款10万*X.XXX%=违约金,具体 ...
- Ubuntu12.04安装YouCompleteMe插件
以前用的都是ctags+omnicomplete+acp的方式,这次换成clang自解析的方式尝试一把. 自从知道了Vundle,妈妈再也不用担心我麻烦地下插件了 0. 安装必要组件 sudo apt ...
- jquery来跨域提交表单
说说用jquery来实现跨域提交表单 在jQuery中,我们使用json数据类型,通过getJSON方法来实现从服务端获取或发送数据,而当要向不同远程服务器端提交或者获取数据时,要采用jsonp数据类 ...
- tc srm 632 500 (规律)
We have a sequence of N positive integers: a[0] through a[N-1]. You do not know these integers. All ...
- ACM - ICPC World Finals 2013 I Pirate Chest
原题下载:http://icpc.baylor.edu/download/worldfinals/problems/icpc2013.pdf 题目翻译: 问题描述 海盗Dick受够了在公海上厮杀.抢劫 ...
- js案例_下滑列表
1.HTML布局(使用ul): <body> <ul> <li class="list" id="lis"> <a h ...
- UVa 714 (二分) Copying Books
首先通过二分来确定这种最大值最小的问题. 假设每个区间的和的最大值为x,那么只要判断的时候只要贪心即可. 也就是如果和不超过x就一直往区间里放数,否则就开辟一个新的区间,这样来判断是否k个区间容得下这 ...