<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[在CentOS 5.4上编译带php-fpm功能的php]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Sat, 23 Jan 2010 04:07:57 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	<br/>http://rashost.com/blog/centos5-vps-compile-php-fpm<br/><br/>本文记录了在CentOS 5 VPS上编译打了php-fpm补丁的php 5.2.10的过程。<br/>安装库文件<br/><br/>安装编译php需要的一些库文件<br/><br/>yum install libxml2-devel libmcrypt-devel openssl-devel curl-devel libjpeg-devel&nbsp;&nbsp;libpng-devel freetype-devel openldap-devel libmhash-devel mysql-devel&nbsp;&nbsp;libtool-ltdl-devel<br/><br/>如果是64位的系统，然后需要调整一下mysql的库文件，否则在64位系统下老去找32位的mysql库:<br/>cd /usr/lib<br/>mv mysql mysql.i386<br/>ln -sf /usr/lib64/mysql mysql<br/>编译php-fpm<br/><br/>给php打php-fpm补丁：<br/><br/>cd php-5.2.10<br/>patch -p1 &lt; ../php-5.2.10-fpm-0.5.13.diff<br/><br/>开始编译php，注意：如果是64位的系统，建议去掉 --with-ldap-sasl，否则有可能编译不过<br/><br/>./configure --prefix=/opt/php --with-iconv --with-zlib --enable-xml --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 --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap&nbsp;&nbsp;--without-pear --with-mysql --with-mysqli --enable-sqlite-utf8 --with-pdo-mysql --enable-ftp --with-jpeg-dir --with-png-dir<br/>make<br/><br/>当编译到php-5.2.10/ext/date/lib/parse_date.c的时候，挂了，好像不往下走了，这时候ctrl-c中断编译过程，把当前正在执行的语句复制粘贴到命令行单独执行，发现还是好像死循环一样不结束，再次ctrl-c中断，删除掉这个命令中的-O2参数，继续执行，这样这个命令很快就结束了，然后继续运行：<br/><br/>make<br/>make install<br/>cp php.ini-dist /opt/php/lib/php.ini<br/><br/>然后运行 /opt/php/sbin/php-fpm start 就可以启动php的fastcgi进程了，这些php fastcgi进程应该可以正常工作了。<br/>优化php-fpm<br/><br/>编辑php-fpm的配置文件/opt/php/etc/php-fpm.conf，<br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;* 去掉display_errors参数的注释，修改参数值为1<br/>&nbsp;&nbsp;&nbsp;&nbsp;* 去掉sendmail_path参数的注释<br/>&nbsp;&nbsp;&nbsp;&nbsp;* 去掉user,group参数的注释，并设定值为nobody<br/>&nbsp;&nbsp;&nbsp;&nbsp;* 修改max_children参数的值为10<br/><br/>安装php加速器eAccelerator<br/><br/>tar jxf eaccelerator-0.9.5.3.tar.bz2<br/>cd eaccelerator-0.9.5.3<br/>yum install -y autoconf<br/>/opt/php/bin/phpize<br/>./configure --enable-eaccelerator --with-php-config=/opt/php/bin/php-config<br/>make<br/>make install<br/>mkdir /opt/php/eaccelerator_cache<br/><br/>然后vim /opt/php/lib/php.ini，在文件末尾加入：<br/><br/>[eaccelerator]<br/>zend_extension=&quot;/opt/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so&quot;<br/>eaccelerator.shm_size=&quot;16&quot;<br/>eaccelerator.cache_dir=&quot;/opt/php/eaccelerator_cache&quot;<br/>eaccelerator.enable=&quot;1&quot;<br/>eaccelerator.optimizer=&quot;1&quot;<br/>eaccelerator.check_mtime=&quot;1&quot;<br/>eaccelerator.debug=&quot;0&quot;<br/>eaccelerator.filter=&quot;&quot;<br/>eaccelerator.shm_max=&quot;0&quot;<br/>eaccelerator.shm_ttl=&quot;3600&quot;<br/>eaccelerator.shm_prune_period=&quot;3600&quot;<br/>eaccelerator.shm_only=&quot;0&quot;<br/>eaccelerator.compress=&quot;1&quot;<br/>eaccelerator.compress_level=&quot;9&quot;<br/><br/>然后重启php-fpm，在phpinfo()页面中应该能看到eaccelerator的信息了。 <br/>打包<br/><br/>我们把/opt/php目录打包放到 http://rashost.com/download 下面，供客户下载使用。<br/><br/>最后，安装好之后，记着在/etc/rc.local文件中加入自动启动php-fpm的语句：<br/><br/>/opt/php/sbin/php-fpm start<br/>
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] 在CentOS 5.4上编译带php-fpm功能的php]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>