<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>猫言猫语 &#187; php</title>
	<atom:link href="http://imcat.in/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://imcat.in</link>
	<description>人的头脑太复杂,时间过得久,有时候连自己也被自己骗了,记下来才是最真实的……</description>
	<lastBuildDate>Fri, 21 Oct 2011 17:55:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>简单的llmp(Litespeed+mysql+php)安装教程</title>
		<link>http://imcat.in/litespeed-mysql-php-install/</link>
		<comments>http://imcat.in/litespeed-mysql-php-install/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 10:01:29 +0000</pubDate>
		<dc:creator>Cat.</dc:creator>
				<category><![CDATA[个人收藏]]></category>
		<category><![CDATA[Litespeed]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://imcat.in/?p=1347</guid>
		<description><![CDATA[(时间比较急,难免有错误) Litespeed是商业软件的,但也有免费版,而且免费版功能都很强大了,其中的实时查看每个站的链接数,实时查看每个站的in/out的流量大小.这2个功能就已经非常讨我喜欢了...更多功能,自己安装体验吧,下面是安装教程. 我选择的操作系统是CentOS,mysql版本5.1.50,php版本为5.3.3 首先用yum命令安装,升级所需的程序库 yum -y install yum-fastestmirror yum -y update yum -y remove httpd yum -y install patch make gcc gcc-c++ gcc-g77 flex bison tar yum -y install libtool libtool-libs kernel-devel autoconf213 yum -y install libjpeg libjpeg-devel libpng libpng-devel yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel yum -y install file glib2 glib2-devel [...]]]></description>
			<content:encoded><![CDATA[<p>(时间比较急,难免有错误)</p>
<p>Litespeed是商业软件的,但也有免费版,而且免费版功能都很强大了,其中的实时查看每个站的链接数,实时查看每个站的in/out的流量大小.这2个功能就已经非常讨我喜欢了...更多功能,自己安装体验吧,下面是安装教程.</p>
<p>我选择的操作系统是CentOS,mysql版本5.1.50,php版本为5.3.3</p>
<p>首先用yum命令安装,升级所需的程序库</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">yum -y install yum-fastestmirror<br />
yum -y update<br />
yum -y remove httpd<br />
yum -y install patch make gcc gcc-c++ gcc-g77 flex bison tar<br />
yum -y install libtool libtool-libs kernel-devel autoconf213<br />
yum -y install libjpeg libjpeg-devel libpng libpng-devel<br />
yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel<br />
yum -y install file glib2 glib2-devel bzip2 diff* openldap-devel<br />
yum -y install bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs<br />
yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel<br />
yum -y install openssl openssl-devel vim-minimal unzip vixie-cron<br />
yum -y install fonts-chinese scim-chewing scim-pinyin scim-tables-chinese<br />
export PHP_AUTOCONF=/usr/bin/autoconf-2.13<br />
export PHP_AUTOHEADER=/usr/bin/autoheader-2.13</div></div>
<p><span id="more-1347"></span><br />
这里是安装PHP 5.2.3所需的支持库：</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget -c http://catlnmp.googlecode.com/files/libiconv-1.13.1.tar.gz<br />
tar zxvf libiconv-1.13.1.tar.gz<br />
cd libiconv-1.13.1/<br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ../</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget -c http://catlnmp.googlecode.com/files/libevent-1.4.14b-stable.tar.gz<br />
tar zxvf libevent-1.4.14b-stable.tar.gz<br />
cd libevent-1.4.14b-stable/<br />
./configure --prefix=/usr<br />
make<br />
make install<br />
cd ../</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget -c http://catlnmp.googlecode.com/files/libmcrypt-2.5.8.tar.gz<br />
tar zxvf libmcrypt-2.5.8.tar.gz<br />
cd libmcrypt-2.5.8/<br />
./configure<br />
make<br />
make install<br />
/sbin/ldconfig<br />
cd libltdl/<br />
./configure --enable-ltdl-install<br />
make<br />
make install<br />
cd ../../</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget -c http://catlnmp.googlecode.com/files/mhash-0.9.9.9.tar.gz<br />
tar zxvf mhash-0.9.9.9.tar.gz<br />
cd mhash-0.9.9.9/<br />
./configure<br />
make<br />
make install<br />
cd ../</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la<br />
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so<br />
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4<br />
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8<br />
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a<br />
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la<br />
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so<br />
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2<br />
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1<br />
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config</div></div>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget -c http://catlnmp.googlecode.com/files/mcrypt-2.6.8.tar.gz<br />
tar zxvf mcrypt-2.6.8.tar.gz<br />
cd mcrypt-2.6.8/<br />
./configure<br />
make<br />
make install<br />
cd ../</div></div>
<p>安装Google的开源TCMalloc库,提高MySQL在高并发情况下的性能</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget -c http://catlnmp.googlecode.com/files/google-perftools-1.6.tar.gz<br />
tar zxvf &nbsp;google-perftools-1.6.tar.gz<br />
cd google-perftools-1.6/<br />
./configure<br />
make &amp;&amp; make install<br />
echo &quot;/usr/local/lib&quot; &gt; /etc/ld.so.conf.d/usr_local_lib.conf<br />
/sbin/ldconfig<br />
cd ../</div></div>
<p>现在安装mysql</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget -c http://catlnmp.googlecode.com/files/mysql-5.1.50.tar.gz<br />
tar -zxvf mysql-5.1.50.tar.gz<br />
cd mysql-5.1.50<br />
./configure --prefix=/usr/local/mysql --with-extra-charsets=all --enable-thread-safe-client --enable-assembler --with-charset=utf8 --enable-thread-safe-client --with-extra-charsets=all --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --without-debug --with-mysqld-ldflags=-ltcmalloc_minimal<br />
make &amp;&amp; make install<br />
cd ../<br />
groupadd mysql<br />
useradd -g mysql mysql<br />
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf<br />
/usr/local/mysql/bin/mysql_install_db --user=mysql<br />
chown -R mysql /usr/local/mysql/var<br />
chgrp -R mysql /usr/local/mysql/.<br />
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql<br />
chmod 755 /etc/init.d/mysql<br />
chkconfig --level 345 mysql on<br />
echo &quot;/usr/local/mysql/lib/mysql&quot; &gt;&gt; /etc/ld.so.conf<br />
echo &quot;/usr/local/lib&quot; &gt;&gt;/etc/ld.so.conf<br />
ldconfig<br />
ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql<br />
ln -s /usr/local/mysql/include/mysql /usr/include/mysql<br />
service mysql start<br />
/usr/local/mysql/bin/mysqladmin -u root password shinko //你的密码<br />
service mysql restart</div></div>
<p>接着安装LiteSpeed</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget http://www.litespeedtech.com/packages/4.0/lsws-4.0.16-std-i386-linux.tar.gz<br />
tar zxvf lsws-4.0.16-std-i386-linux.tar.gz<br />
cd lsws-4.0.16<br />
./install.sh</div></div>
<p>出现--More--（27%）的许可协议,可以直接按空格键或者回车跳到最后.<br />
Do you agree with above license?  #这里需要输入Yes （Y要大写）<br />
下面的基本一直回车和选Y就OK了</p>
<p>安装完成就可以访问http://IP:7080来管理LiteSpeed,</p>
<p>最后就是安装php了,在litespeed控制面板选择Compile PHP<br />
然后选择要安装的php版本,我这里选择php5.3.3,然后用以下参数编译</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">--with-mysql=mysqlnd --with-mysqli=mysqlnd &nbsp;--with-iconv=/usr/local --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 --with-curlwrappers --enable-mbregex --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 --enable-ftp --disable-debug --with-gettext --with-openssl</div></div>
<p>然后下一步,是程序自动下载安装文件,下载完成后继续下一步,就去到安装画面了.在ssh下运行这句语句,</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/usr/local/lsws/phpbuild/buildphp_manual_run.sh</div></div>
<p>等待几分钟就会安装完成了,如果安装失败,请查看log错误...</p>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/" title="一步一步教你安装Nginx+PHP+Mysql">一步一步教你安装Nginx+PHP+Mysql</a> (56)</li><li><a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/" title="debian安装nginx+php(spawn-fcgi)+mysql">debian安装nginx+php(spawn-fcgi)+mysql</a> (10)</li><li><a href="http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/" title="最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包">最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包</a> (36)</li><li><a href="http://imcat.in/simple-configuration-nginx-litespeed/" title="简单配置Nginx前端处理静态文件,LiteSpeed后端处理动态文件">简单配置Nginx前端处理静态文件,LiteSpeed后端处理动态文件</a> (30)</li><li><a href="http://imcat.in/delete-mysql-bin-0000x-mysql-log-file/" title="删除Mysql的MySql-bin.0000X日志文件">删除Mysql的MySql-bin.0000X日志文件</a> (2)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/litespeed-mysql-php-install/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>一步一步教你安装Nginx+PHP+Mysql</title>
		<link>http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/</link>
		<comments>http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 10:29:32 +0000</pubDate>
		<dc:creator>Cat.</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://imcat.in/?p=1224</guid>
		<description><![CDATA[发现很多VPS用LNMP一键安装包都 失败,有不能排错,唯有给出教程,一步一步教你安装,所谓授人于鱼不如授人于渔嘛,本文是在CentOS 5.4 操作系统下测试通过的,用的是DiaHosting上 的32位系统,为什么要用32位系统?就是为了节省内存,VPS内存都不是很多的,纯32位系统比X86_X64兼用32位系统更省内存. 安装步骤: 1,升级系统和安装相关的程序库 yum -y install yum-fastestmirror yum -y update yum -y install patch make gcc gcc-c++ gcc-g77 flex bison yum -y install libtool libtool-libs kernel-devel autoconf yum -y install libjpeg libjpeg-devel libpng libpng-devel yum -y install freetype freetype-devel libxml2 libxml2-devel zlib &#160;zlib-devel yum -y install glib2 glib2-devel bzip2 diff* yum [...]]]></description>
			<content:encoded><![CDATA[<p>发现很多VPS用LNMP<a href="http://imcat.in/lnmp/" target="_blank">一键安装包</a>都 失败,有不能排错,唯有给出教程,一步一步教你安装,所谓授人于鱼不如授人于渔嘛,本文是在CentOS 5.4 操作系统下测试通过的,用的是<a href="http://www.diahosting.com/client/aff.php?aff=270" target="_blank">DiaHosting</a>上 的32位系统,为什么要用32位系统?就是为了节省内存,VPS内存都不是很多的,纯32位系统比X86_X64兼用32位系统更省内存.</p>
<p>安装步骤:<br />
<span id="more-1224"></span><br />
1,升级系统和安装相关的程序库</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">yum -y install yum-fastestmirror<br />
yum -y update<br />
yum -y install patch make gcc gcc-c++ gcc-g77 flex bison<br />
yum -y install libtool libtool-libs kernel-devel autoconf<br />
yum -y install libjpeg libjpeg-devel libpng libpng-devel<br />
yum -y install freetype freetype-devel libxml2 libxml2-devel zlib &nbsp;zlib-devel<br />
yum -y install glib2 glib2-devel bzip2 diff*<br />
yum -y install bzip2-devel ncurses ncurses-devel curl curl-devel &nbsp;e2fsprogs<br />
yum -y install e2fsprogs-devel krb5 krb5-devel libidn libidn-devel<br />
yum -y install openssl openssl-devel vim-minimal<br />
yum -y install fonts-chinese scim-chewing scim-pinyin &nbsp;scim-tables-chinese</div></div>
<p>2,下载相关程序源码包</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget http://catlnmp.googlecode.com/files/libiconv-1.13.1.tar.gz<br />
wget http://catlnmp.googlecode.com/files/libmcrypt-2.5.8.tar.gz<br />
wget http://catlnmp.googlecode.com/files/mhash-0.9.9.9.tar.gz<br />
wget http://catlnmp.googlecode.com/files/mcrypt-2.6.8.tar.gz<br />
wget http://catlnmp.googlecode.com/files/mysql-5.1.44.tar.gz<br />
wget http://php-fpm.org/downloads/php-5.2.13-fpm-0.5.13.diff.gz<br />
wget http://www.sfr-fresh.com/unix/www/php-5.2.13.tar.gz<br />
wget http://catlnmp.googlecode.com/files/memcache-2.2.5.tgz<br />
wget http://catlnmp.googlecode.com/files/PDO_MYSQL-1.0.2.tgz<br />
wget http://catlnmp.googlecode.com/files/eaccelerator-0.9.6.tar.bz2<br />
wget &nbsp;http://catlnmp.googlecode.com/files/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz<br />
wget &nbsp;http://catlnmp.googlecode.com/files/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz<br />
wget http://catlnmp.googlecode.com/files/pcre-8.01.tar.gz<br />
wget http://catlnmp.googlecode.com/files/nginx-0.7.65.tar.gz<br />
wget &nbsp;http://catlnmp.googlecode.com/files/phpMyAdmin-3.2.4-all-languages.tar.gz<br />
wget http://catlnmp.googlecode.com/files/index.php</div></div>
<p>3,开始安装,先安装PHP需要的库程序</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf libiconv-1.13.1.tar.gz<br />
cd libiconv-1.13.1/<br />
./configure --prefix=/usr/local<br />
make<br />
make install<br />
cd ../<br />
<br />
tar zxvf libmcrypt-2.5.8.tar.gz<br />
cd libmcrypt-2.5.8/<br />
./configure<br />
make<br />
make install<br />
/sbin/ldconfig<br />
cd libltdl/<br />
./configure --enable-ltdl-install<br />
make<br />
make install<br />
cd ../../<br />
<br />
tar zxvf mhash-0.9.9.9.tar.gz<br />
cd mhash-0.9.9.9/<br />
./configure<br />
make<br />
make install<br />
cd ../<br />
<br />
ln -s /usr/local/lib/libmcrypt.la /usr/lib/libmcrypt.la<br />
ln -s /usr/local/lib/libmcrypt.so /usr/lib/libmcrypt.so<br />
ln -s /usr/local/lib/libmcrypt.so.4 /usr/lib/libmcrypt.so.4<br />
ln -s /usr/local/lib/libmcrypt.so.4.4.8 /usr/lib/libmcrypt.so.4.4.8<br />
ln -s /usr/local/lib/libmhash.a /usr/lib/libmhash.a<br />
ln -s /usr/local/lib/libmhash.la /usr/lib/libmhash.la<br />
ln -s /usr/local/lib/libmhash.so /usr/lib/libmhash.so<br />
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2<br />
ln -s /usr/local/lib/libmhash.so.2.0.1 /usr/lib/libmhash.so.2.0.1<br />
ln -s /usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config<br />
<br />
tar zxvf mcrypt-2.6.8.tar.gz<br />
cd mcrypt-2.6.8/<br />
./configure<br />
make<br />
make install<br />
cd ../</div></div>
<p>4,安装mysql</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar -zxvf mysql-5.1.44.tar.gz<br />
cd mysql-5.1.44<br />
./configure --prefix=/usr/local/mysql --with-extra-charsets=all --enable-thread-safe-client --enable-assembler --with-charset=utf8 --enable-thread-safe-client --with-extra-charsets=all --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile --without-debug<br />
make &amp;amp;&amp;amp; make install<br />
cd ../</div></div>
<p>创建MySQL数据库,用默认的配置my.cnf</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">groupadd mysql<br />
useradd -g mysql mysql<br />
cp /usr/local/mysql/share/mysql/my-medium.cnf /etc/my.cnf<br />
/usr/local/mysql/bin/mysql_install_db --user=mysql<br />
chown -R mysql /usr/local/mysql/var<br />
chgrp -R mysql /usr/local/mysql/.</div></div>
<p>添加Mysql启动服务,并且设置root密码</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql<br />
chmod 755 /etc/init.d/mysql<br />
chkconfig --level 345 mysql on<br />
echo &quot;/usr/local/mysql/lib/mysql&quot; &amp;gt;&amp;gt; /etc/ld.so.conf<br />
echo &quot;/usr/local/lib&quot; &amp;gt;&amp;gt;/etc/ld.so.conf<br />
ldconfig<br />
ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql<br />
ln -s /usr/local/mysql/include/mysql /usr/include/mysql<br />
service mysql start<br />
/usr/local/mysql/bin/mysqladmin -u root password root &nbsp; &nbsp;//root改为你需要的密码<br />
service mysql restart</div></div>
<p>5,安装PHP（FastCGI模式）</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf php-5.2.13.tar.gz<br />
gzip -cd php-5.2.13-fpm-0.5.13.diff.gz | patch -d php-5.2.13 -p1<br />
cd php-5.2.13/<br />
./buildconf --force<br />
./configure --prefix=/usr/local/php &nbsp;--with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql &nbsp;--with-mysqli=/usr/local/mysql/bin/mysql_config &nbsp;--with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir &nbsp;--with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml &nbsp;--disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath &nbsp;--enable-shmop --enable-sysvsem --enable-inline-optimization &nbsp;--with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi &nbsp;--enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt &nbsp;--with-gd --enable-gd-native-ttf --with-mhash --enable-pcntl &nbsp;--enable-sockets --with-xmlrpc --enable-zip --enable-ftp<br />
make ZEND_EXTRA_LIBS='-liconv'<br />
make install<br />
cp php.ini-dist /usr/local/php/etc/php.ini<br />
cd ../</div></div>
<p>6,安装PHP扩展模块</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf memcache-2.2.5.tgz<br />
cd memcache-2.2.5/<br />
/usr/local/php/bin/phpize<br />
./configure --with-php-config=/usr/local/php/bin/php-config<br />
make<br />
make install<br />
cd ../<br />
<br />
tar zxvf PDO_MYSQL-1.0.2.tgz<br />
cd PDO_MYSQL-1.0.2/<br />
/usr/local/php/bin/phpize<br />
./configure --with-php-config=/usr/local/php/bin/php-config &nbsp;--with-pdo-mysql=/usr/local/mysql<br />
make<br />
make install<br />
cd ../<br />
<br />
tar jxvf eaccelerator-0.9.6.tar.bz2<br />
cd eaccelerator-0.9.6/<br />
/usr/local/php/bin/phpize<br />
./configure --enable-eaccelerator=shared &nbsp;--with-php-config=/usr/local/php/bin/php-config<br />
make<br />
make install<br />
cd ../</div></div>
<p>安装Zend Optimizer,32位系统版本</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz<br />
mkdir -p /usr/local/zend/<br />
cp &nbsp;ZendOptimizer-3.3.9-linux-glibc23-i386/data/5_2_x_comp/ZendOptimizer.so &nbsp;/usr/local/zend/</div></div>
<p>如果是64位系统,则</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz<br />
mkdir -p /usr/local/zend/<br />
cp &nbsp;ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so &nbsp;/usr/local/zend/</div></div>
<p>配置php.ini</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cat &amp;gt;&amp;gt;/usr/local/php/etc/php.ini&amp;lt;</div></div>
<p>7,修改php.ini文件<br />
<strong>手工修改</strong>：查找/usr/local/php/etc/php.ini中的extension_dir = "./"<br />
修改为extension_dir =  "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"<br />
并在此行后增加以下几行，然后保存：<br />
extension = "memcache.so"<br />
extension = "pdo_mysql.so"</p>
<p>再查找 output_buffering = Off<br />
修改为output_buffering = On</p>
<p><strong>自动修改</strong>:可执行以下shell命令,自动完成对php.ini文件的修改:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sed -i 's#extension_dir = &quot;./&quot;#extension_dir = &nbsp;&quot;/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/&quot;nextension &nbsp;= &quot;memcache.so&quot;nextension = &quot;pdo_mysql.so&quot;n#' &nbsp;/usr/local/php/etc/php.ini<br />
sed -i 's#output_buffering = Off#output_buffering = On#' &nbsp;/usr/local/php/etc/php.ini</div></div>
<p>8,配置eAccelerator加速PHP:<br />
创建缓存目录</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mkdir -p /usr/local/eaccelerator_cache</div></div>
<p>配置php.ini</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cat &gt;&gt;/usr/local/php/etc/php.ini&lt; &lt;EOF<br />
[eaccelerator]<br />
zend_extension=&quot;/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/eaccelerator.so&quot;<br />
eaccelerator.shm_size=&quot;16&quot;<br />
eaccelerator.cache_dir=&quot;/usr/local/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 />
EOF</div></div>
<p>9,创建www用户和组,以及主机需要的目录,日志目录<br />
</code></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">groupadd www<br />
useradd -g www www<br />
mkdir -p /home/www<br />
chmod +w /home/www<br />
mkdir -p /home/www/logs<br />
chmod 777 /home/www/logs<br />
chown -R www:www /home/www</div></div>
<p>10,创建php-fpm配置文件</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rm -f /usr/local/php/etc/php-fpm.conf<br />
vi /usr/local/php/etc/php-fpm.conf</div></div>
<p>输入以下内容,我设置开的进程是5个.需要更改进程数,可以修改5</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;configuration&gt;<br />
&nbsp; All relative paths in this config are relative to php's install prefix &nbsp; <br />
&nbsp; &lt;section name=&quot;global_options&quot;&gt;<br />
&nbsp; &nbsp; Pid file &nbsp; <br />
&nbsp; &nbsp; &lt;value name=&quot;pid_file&quot;&gt;/usr/local/php/logs/php-fpm.pid&lt;/value&gt;<br />
&nbsp; &nbsp; Error log file &nbsp; <br />
&nbsp; &nbsp; &lt;value name=&quot;error_log&quot;&gt;/usr/local/php/logs/php-fpm.log&lt;/value&gt;<br />
&nbsp; &nbsp; Log level &nbsp; <br />
&nbsp; &nbsp; &lt;value name=&quot;log_level&quot;&gt;notice&lt;/value&gt;<br />
&nbsp; &nbsp; When this amount of php processes exited with SIGSEGV or SIGBUS ... &nbsp; <br />
&nbsp; &nbsp; &lt;value name=&quot;emergency_restart_threshold&quot;&gt;10&lt;/value&gt;<br />
&nbsp; &nbsp; ... in a less than this interval of time, a graceful restart will be initiated. &nbsp; <br />
&nbsp; &nbsp; Useful to work around accidental curruptions in accelerator's shared memory. &nbsp; <br />
&nbsp; &nbsp; &lt;value name=&quot;emergency_restart_interval&quot;&gt;1m&lt;/value&gt;<br />
&nbsp; &nbsp; Time limit on waiting child's reaction on signals from master &nbsp; <br />
&nbsp; &nbsp; &lt;value name=&quot;process_control_timeout&quot;&gt;5s&lt;/value&gt;<br />
&nbsp; &nbsp; Set to 'no' to debug fpm &nbsp; <br />
&nbsp; &nbsp; &lt;value name=&quot;daemonize&quot;&gt;yes&lt;/value&gt;<br />
&nbsp; &lt;/section&gt;<br />
&nbsp; &lt;workers&gt;<br />
&nbsp; &nbsp; &lt;section name=&quot;pool&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; Name of pool. Used in logs and stats. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;name&quot;&gt;default&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; Address to accept fastcgi requests on. &nbsp; <br />
&nbsp; &nbsp; &nbsp; Valid syntax is 'ip.ad.re.ss:port' or just 'port' or '/path/to/unix/socket' &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;listen_address&quot;&gt;/tmp/php-cgi.sock&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;listen_options&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; Set listen(2) backlog &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/value&gt;&lt;value name=&quot;backlog&quot;&gt;-1&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; Set permissions for unix socket, if one used. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; In Linux read/write permissions must be set in order to allow connections from web server. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; Many BSD-derrived systems allow connections regardless of permissions. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;owner&quot;&gt;&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;group&quot;&gt;&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;mode&quot;&gt;0666&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; Additional php.ini defines, specific to this pool of workers. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;php_defines&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/value&gt;&lt;value name=&quot;sendmail_path&quot;&gt;/usr/sbin/sendmail -t -i&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;display_errors&quot;&gt;1&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; Unix user of processes &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;user&quot;&gt;www&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; Unix group of processes &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;group&quot;&gt;www&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; Process manager settings &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;pm&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; Sets style of controling worker process count. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; Valid values are 'static' and 'apache-like' &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/value&gt;&lt;value name=&quot;style&quot;&gt;static&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; Sets the limit on the number of simultaneous requests that will be served. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; Equivalent to Apache MaxClients directive. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; Equivalent to PHP_FCGI_CHILDREN environment in original php.fcgi &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; Used with any pm_style. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;max_children&quot;&gt;5&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; Settings group for 'apache-like' pm style &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;apache_like&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sets the number of server processes created on startup. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Used only when 'apache-like' pm_style is selected &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/value&gt;&lt;value name=&quot;StartServers&quot;&gt;20&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sets the desired minimum number of idle server processes. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Used only when 'apache-like' pm_style is selected &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;MinSpareServers&quot;&gt;5&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sets the desired maximum number of idle server processes. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Used only when 'apache-like' pm_style is selected &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;MaxSpareServers&quot;&gt;35&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; The timeout (in seconds) for serving a single request after which the worker process will be terminated &nbsp; <br />
&nbsp; &nbsp; &nbsp; Should be used when 'max_execution_time' ini option does not stop script execution for some reason &nbsp; <br />
&nbsp; &nbsp; &nbsp; '0s' means 'off' &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;request_terminate_timeout&quot;&gt;0s&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; The timeout (in seconds) for serving of single request after which a php backtrace will be dumped to slow.log file &nbsp; <br />
&nbsp; &nbsp; &nbsp; '0s' means 'off' &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;request_slowlog_timeout&quot;&gt;0s&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; The log file for slow requests &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;slowlog&quot;&gt;logs/slow.log&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; Set open file desc rlimit &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;rlimit_files&quot;&gt;51200&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; Set max core size rlimit &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;rlimit_core&quot;&gt;0&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; Chroot to this directory at the start, absolute path &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;chroot&quot;&gt;&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; Chdir to this directory at the start, absolute path &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;chdir&quot;&gt;&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; Redirect workers' stdout and stderr into main error log. &nbsp; <br />
&nbsp; &nbsp; &nbsp; If not set, they will be redirected to /dev/null, according to FastCGI specs &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;catch_workers_output&quot;&gt;yes&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; How much requests each process should execute before respawn. &nbsp; <br />
&nbsp; &nbsp; &nbsp; Useful to work around memory leaks in 3rd party libraries. &nbsp; <br />
&nbsp; &nbsp; &nbsp; For endless request processing please specify 0 &nbsp; <br />
&nbsp; &nbsp; &nbsp; Equivalent to PHP_FCGI_MAX_REQUESTS &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;max_requests&quot;&gt;10240&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; Comma separated list of ipv4 addresses of FastCGI clients that allowed to connect. &nbsp; <br />
&nbsp; &nbsp; &nbsp; Equivalent to FCGI_WEB_SERVER_ADDRS environment in original php.fcgi (5.2.2+) &nbsp; <br />
&nbsp; &nbsp; &nbsp; Makes sense only with AF_INET listening socket. &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;allowed_clients&quot;&gt;127.0.0.1&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; Pass environment variables like LD_LIBRARY_PATH &nbsp; <br />
&nbsp; &nbsp; &nbsp; All $VARIABLEs are taken from current environment &nbsp; <br />
&nbsp; &nbsp; &nbsp; &lt;value name=&quot;environment&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/value&gt;&lt;value name=&quot;HOSTNAME&quot;&gt;$HOSTNAME&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;PATH&quot;&gt;/usr/local/bin:/usr/bin:/bin&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;TMP&quot;&gt;/tmp&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;TMPDIR&quot;&gt;/tmp&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;TEMP&quot;&gt;/tmp&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;OSTYPE&quot;&gt;$OSTYPE&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;MACHTYPE&quot;&gt;$MACHTYPE&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;value name=&quot;MALLOC_CHECK_&quot;&gt;2&lt;/value&gt;<br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &lt;/section&gt;<br />
&nbsp; &lt;/workers&gt;<br />
&lt;/configuration&gt;</div></div>
<p>11,启动php-cgi进程,监听127.0.0.1的9000端口,进程数为5,用户为www</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ulimit -SHn 65535<br />
/usr/local/php/sbin/php-fpm start</div></div>
<p>注:/usr/local/php/sbin/php-fpm还有其他参数,包 括:start|stop|quit|restart|reload|logrotate,修改php.ini后不重启php-cgi,重新加载配置文件 使用reload</p>
<p>12,安装Nginx</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf pcre-8.01.tar.gz<br />
cd pcre-8.01/<br />
./configure<br />
make &amp;&amp; make install<br />
cd ../<br />
<br />
tar zxvf nginx-0.7.65.tar.gz<br />
cd nginx-0.7.65/<br />
./configure --user=www --group=www --prefix=/usr/local/nginx &nbsp;--with-http_stub_status_module --with-http_ssl_module &nbsp;--with-http_gzip_static_module<br />
make &amp;&amp; make install<br />
cd ../</div></div>
<p>13,创建Nginx配置文件</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mkdir -p /usr/local/nginx/conf/servers<br />
rm -f /usr/local/nginx/conf/nginx.conf<br />
vi /usr/local/nginx/conf/nginx.conf</div></div>
<p>输入以下内容:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">user &nbsp;www www;<br />
worker_processes 1;<br />
error_log &nbsp;/home/www/logs/nginx_error.log &nbsp;crit;<br />
pid &nbsp; &nbsp; &nbsp; &nbsp;/usr/local/nginx/nginx.pid;<br />
#Specifies the value for maximum file descriptors that can be opened by &nbsp;this process.<br />
worker_rlimit_nofile 65535;<br />
events<br />
{<br />
use epoll;<br />
worker_connections 65535;<br />
}<br />
http<br />
{<br />
include &nbsp; &nbsp; &nbsp; mime.types;<br />
default_type &nbsp;application/octet-stream;<br />
#charse &nbsp;gb2312;<br />
server_names_hash_bucket_size 128;<br />
client_header_buffer_size 128k;<br />
large_client_header_buffers 4 256k;<br />
client_max_body_size 8m;<br />
sendfile on;<br />
tcp_nopush &nbsp; &nbsp; on;<br />
keepalive_timeout 60;<br />
tcp_nodelay on;<br />
<br />
fastcgi_connect_timeout 300;<br />
fastcgi_send_timeout 300;<br />
fastcgi_read_timeout 300;<br />
fastcgi_buffer_size 64k;<br />
fastcgi_buffers 4 64k;<br />
fastcgi_busy_buffers_size 128k;<br />
fastcgi_temp_file_write_size 128k;<br />
<br />
gzip on;<br />
gzip_min_length &nbsp;1k;<br />
gzip_buffers &nbsp; &nbsp; 4 16k;<br />
gzip_http_version 1.1;<br />
gzip_comp_level 9;<br />
gzip_types &nbsp; &nbsp; &nbsp; text/plain application/x-javascript text/css &nbsp;application/xml;<br />
gzip_vary on;<br />
output_buffers &nbsp; 4 32k;<br />
postpone_output &nbsp;1460;<br />
<br />
#limit_zone &nbsp;crawler &nbsp;$binary_remote_addr &nbsp;10m;<br />
<br />
server<br />
{<br />
listen &nbsp; &nbsp; &nbsp; 80;<br />
server_name vps.imcat.in;<br />
index index.html index.htm index.php;<br />
include location.conf;<br />
root &nbsp;/home/www;<br />
}<br />
include servers/*;<br />
}</div></div>
<p>14,在/usr/local/nginx/conf/目录中创建location.conf文件：</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">vi /usr/local/nginx/conf/location.conf</div></div>
<p>输入内容:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">location ~ .*.(php|php5)?$<br />
{<br />
#fastcgi_pass &nbsp;unix:/tmp/php-cgi.sock;<br />
fastcgi_pass &nbsp;127.0.0.1:9000;<br />
fastcgi_index index.php;<br />
include fastcgi.conf;<br />
}<br />
<br />
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$<br />
{<br />
expires &nbsp; &nbsp; &nbsp;30d;<br />
}<br />
<br />
location ~ .*.(js|css)?$<br />
{<br />
expires &nbsp; &nbsp; &nbsp;12h;<br />
}</div></div>
<p>多站点管理,可以在/usr/local/nginx/conf/servers目录添加配置文件,格式为:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">vi /usr/local/nginx/conf/servers/imcat.conf</div></div>
<p>内容:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">server<br />
<br />
{<br />
listen &nbsp; &nbsp; &nbsp; 80;<br />
server_name imcat.in;<br />
index index.html index.htm index.php;<br />
root &nbsp;/home/www/imcat;<br />
}</div></div>
<p>请注意,我是没有开启Nginx日志记录功能的.<br />
启动Nginx:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ulimit -SHn 65535<br />
/usr/local/nginx/sbin/nginx</div></div>
<p>放个探针看看</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mv index.php /home/www/</div></div>
<p>访问你的IP看看吧!</p>
<p>15,安装phpMyAdmin,管理Mysql数据库</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar zxvf phpMyAdmin-3.2.4-all-languages.tar.gz<br />
mv phpMyAdmin-3.2.4-all-languages /home/www/phpmyadmin</div></div>
<p>16,配置开机自动启动Nginx + PHP</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">echo &quot;ulimit -SHn 65535&quot; &amp;gt;&amp;gt;/etc/rc.local<br />
echo &quot;/usr/local/php/sbin/php-fpm start&quot; &amp;gt;&amp;gt;/etc/rc.local<br />
echo &quot;/usr/local/nginx/sbin/nginx&quot; &amp;gt;&amp;gt;/etc/rc.local</div></div>
<p>17,优化Linux内核参数(我只在Xen VPS用过,Openvz VPS失败,慎用)</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">vi /etc/sysctl.conf</div></div>
<p>在最后加入</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># Add<br />
net.ipv4.tcp_max_syn_backlog = 65536<br />
net.core.netdev_max_backlog = &nbsp;32768<br />
net.core.somaxconn = 32768<br />
<br />
net.core.wmem_default = 8388608<br />
net.core.rmem_default = 8388608<br />
net.core.rmem_max = 16777216<br />
net.core.wmem_max = 16777216<br />
<br />
net.ipv4.tcp_timestamps = 0<br />
net.ipv4.tcp_synack_retries = 2<br />
net.ipv4.tcp_syn_retries = 2<br />
<br />
net.ipv4.tcp_tw_recycle = 1<br />
#net.ipv4.tcp_tw_len = 1<br />
net.ipv4.tcp_tw_reuse = 1<br />
<br />
net.ipv4.tcp_mem = 94500000 915000000 927000000<br />
net.ipv4.tcp_max_orphans = 3276800<br />
<br />
#net.ipv4.tcp_fin_timeout = 30<br />
#net.ipv4.tcp_keepalive_time = 120<br />
net.ipv4.ip_local_port_range = 1024 &nbsp;65535</div></div>
<p>使配置立即生效：</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/sbin/sysctl -p</div></div>
<p>18,需要安装ftp的,可以简单安装vsftpd应用:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">yum -y install vsftpd<br />
/etc/init.d/vsftpd start<br />
chkconfig --level 345 vsftpd on</div></div>
<p>19,请务必更改www用户密码:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">passwd www</div></div>
<p>全文完!欢迎抓错误!</p>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/" title="debian安装nginx+php(spawn-fcgi)+mysql">debian安装nginx+php(spawn-fcgi)+mysql</a> (10)</li><li><a href="http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/" title="最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包">最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包</a> (36)</li><li><a href="http://imcat.in/litespeed-mysql-php-install/" title="简单的llmp(Litespeed+mysql+php)安装教程">简单的llmp(Litespeed+mysql+php)安装教程</a> (17)</li><li><a href="http://imcat.in/wordpress-on-nginx-apache-mod_rewrite-enabled/" title="WordPress在Nginx中启用Apache的mod_rewrite">WordPress在Nginx中启用Apache的mod_rewrite</a> (6)</li><li><a href="http://imcat.in/simple-configuration-nginx-litespeed/" title="简单配置Nginx前端处理静态文件,LiteSpeed后端处理动态文件">简单配置Nginx前端处理静态文件,LiteSpeed后端处理动态文件</a> (30)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/feed/</wfw:commentRss>
		<slash:comments>56</slash:comments>
		</item>
		<item>
		<title>Suhosin - 保护你的PHP</title>
		<link>http://imcat.in/suhosin-protect-your-php/</link>
		<comments>http://imcat.in/suhosin-protect-your-php/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 03:23:19 +0000</pubDate>
		<dc:creator>Cat.</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Suhosin]]></category>

		<guid isPermaLink="false">http://imcat.in/suhosin-%e4%bf%9d%e6%8a%a4%e4%bd%a0%e7%9a%84php/</guid>
		<description><![CDATA[Suhosin 我是在无意中发现的, 上次在 debian 用自动安装PHP,安装完后发现被安装了 Hardened-PHP Project .Google下,原来这个东西叫 Suhosin ,朝鲜语,译音为 "保护神" . Suhosin的作用大概是: 保护服务器和已知或未知的缺陷,类似内存泄漏等等吧 解决php的“远程文件包含”带来的安全隐患,例如PHP禁止allow_url_fopen选项,但不能彻底禁止通过PHP的攻击,Suhosin就修补了这个缺憾. 可使用额外的配置来禁止一些php中可能带来安全隐患的功能 另外,Suhosin是兼容ZendOptimizer 的 我英语不好,如果你英语好的去官网看看:Suhosin .不废话了,说说安装方法吧 首先去下载PHP版本对应的Suhosin补丁:http://www.hardened-php.net/suhosin/download.html 我的是PHP 5.2.11 所以我下载的是 suhosin-patch-5.2.11 解压suhosin-patch-5.2.11: gzip -d ./suhosin-patch-5.2.11-0.9.7.patch.gz 进入php源代码目录打上补丁： gzip -cd php-5.2.11-fpm-0.5.13.diff.gz &#124; patch -d php-5.2.11 -p1 cd php-5.2.11 patch -p 1 -i ../suhosin-patch-5.2.11-0.9.7.patch 因为我要安装phpfpm,所以将补丁一起打上.. 接着重建php的configure脚本 ./buildconf --force 然后编译安装 ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config [...]]]></description>
			<content:encoded><![CDATA[<p>Suhosin 我是在无意中发现的, 上次在 <a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/">debian</a> 用自动安装PHP,安装完后发现被安装了 <a href="http://www.hardened-php.net/">Hardened-PHP Project</a> .Google下,原来这个东西叫 Suhosin ,朝鲜语,译音为 "保护神" .</p>
<p>Suhosin的作用大概是:</p>
<blockquote><p>保护服务器和已知或未知的缺陷,类似内存泄漏等等吧<br />
解决php的“远程文件包含”带来的安全隐患,例如PHP禁止allow_url_fopen选项,但不能彻底禁止通过PHP的攻击,Suhosin就修补了这个缺憾.<br />
可使用额外的配置来禁止一些php中可能带来安全隐患的功能<br />
另外,Suhosin是兼容ZendOptimizer 的</p></blockquote>
<p>我英语不好,如果你英语好的去官网看看:<a href="http://www.hardened-php.net/suhosin.127.html">Suhosin</a> .不废话了,说说安装方法吧</p>
<p><span id="more-1052"></span></p>
<p>首先去下载PHP版本对应的Suhosin补丁:http://www.hardened-php.net/suhosin/download.html</p>
<p>我的是PHP 5.2.11 所以我下载的是 suhosin-patch-5.2.11</p>
<p>解压suhosin-patch-5.2.11:</p>
<blockquote><p>gzip -d ./suhosin-patch-5.2.11-0.9.7.patch.gz</p></blockquote>
<p>进入php源代码目录打上补丁：</p>
<blockquote><p>
gzip -cd php-5.2.11-fpm-0.5.13.diff.gz | patch -d php-5.2.11 -p1<br />
cd php-5.2.11<br />
patch -p 1 -i ../suhosin-patch-5.2.11-0.9.7.patch
</p></blockquote>
<p>因为我要安装phpfpm,所以将补丁一起打上..</p>
<p>接着重建php的configure脚本</p>
<blockquote><p>./buildconf --force</p></blockquote>
<p>然后编译安装</p>
<blockquote><p>./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --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-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-ftp --enable-suhosin<br />
make ZEND_EXTRA_LIBS='-liconv'<br />
make install</p></blockquote>
<p>等php编译完成以后，重新php进程或者重启服务器,如果你看到下面这个图，那么恭喜你，守护神已经正常工作了：<br />
<a href="/wp-content/uploads/2009/12/suhosin.jpg"><img class="alignnone size-full wp-image-1051" title="suhosin" src="/wp-content/uploads/2009/12/suhosin.jpg" alt="suhosin Suhosin   保护你的PHP" width="422" height="33" /></a></p>
<p>对于已经编译了的PHP程序,只需要重新编译一次就OK:</p>
<blockquote><p>./configure --enable-suhosin --with-what-you-want<br />
make ZEND_EXTRA_LIBS='-liconv'<br />
make install</p></blockquote>
<p><span style="color: #ff0000;">对了,转载的请注明个链接,我发现我一篇<a title="安装apc为php加速" href="../apc-for-php-installed-to-speed-up/">安装apc为php加速</a>被人转载了N次,没加链接的,虽然我不介意.</span></p>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/" title="debian安装nginx+php(spawn-fcgi)+mysql">debian安装nginx+php(spawn-fcgi)+mysql</a> (10)</li><li><a href="http://imcat.in/apc-for-php-installed-to-speed-up/" title="安装apc为php加速">安装apc为php加速</a> (14)</li><li><a href="http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/" title="最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包">最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包</a> (36)</li><li><a href="http://imcat.in/linux-tar-exclude/" title="Linux命令tar压缩排除指定目录的方法">Linux命令tar压缩排除指定目录的方法</a> (0)</li><li><a href="http://imcat.in/iptables-limit-number-connections-same-ip/" title="iptables限制同一IP连接数">iptables限制同一IP连接数</a> (3)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/suhosin-protect-your-php/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>debian安装nginx+php(spawn-fcgi)+mysql</title>
		<link>http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/</link>
		<comments>http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 12:20:14 +0000</pubDate>
		<dc:creator>Cat.</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php spawn-fcgi]]></category>

		<guid isPermaLink="false">http://imcat.in/debian%e5%ae%89%e8%a3%85nginxphpspawn-fcgimysql/</guid>
		<description><![CDATA[前天购买了linode最低的那款VPS,一直用的都是CentOS系统,所以这次就试了试debian ,毕竟国外debian使用率占了半壁江山 linode的控制面板很好用,很方便,一下就安装debian 5.0 ,下载是昨天安装nginx+php(spawn-fcgi)+mysql 的记录 首先是添加源地址,目的只有一个,我要安装最新版的软件,debian默认的软件版本低啊 vi /etc/apt/sources.list deb http://packages.dotdeb.org lenny all 接着,当然是更新一下系统啦. apt-get update 下面是安装mysql5.1,安装过程会需要你输入root密码的 apt-get install mysql-server-5.1 /etc/init.d/mysql restart /etc/init.d/mysql stop 接着是PHP5,自己选择需要安装的扩展吧 apt-get install php5-common php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-apc 安装nginx,代码如果下 apt-get install libpcre3 libpcre3-dev libpcrecpp0 [...]]]></description>
			<content:encoded><![CDATA[<p>前天购买了linode最低的那款VPS,一直用的都是CentOS系统,所以这次就试了试debian ,毕竟国外debian使用率占了半壁江山</p>
<p>linode的控制面板很好用,很方便,一下就安装debian 5.0 ,下载是昨天安装nginx+php(spawn-fcgi)+mysql 的记录</p>
<p>首先是添加源地址,目的只有一个,我要安装最新版的软件,debian默认的软件版本低啊</p>
<blockquote><p>vi /etc/apt/sources.list<br />
deb http://packages.dotdeb.org lenny all</p></blockquote>
<p>接着,当然是更新一下系统啦.<br />
apt-get update</p>
<p>下面是安装mysql5.1,安装过程会需要你输入root密码的</p>
<p><span id="more-1050"></span></p>
<blockquote><p>apt-get install mysql-server-5.1<br />
/etc/init.d/mysql restart<br />
/etc/init.d/mysql stop</p></blockquote>
<p>接着是PHP5,自己选择需要安装的扩展吧</p>
<blockquote><p>apt-get install php5-common php5-cgi php5-mysql php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-apc</p></blockquote>
<p>安装nginx,代码如果下</p>
<blockquote><p>apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev build-essential<br />
wget http://sysoev.ru/nginx/nginx-0.7.64.tar.gz<br />
tar zxvf nginx-0.7.64.tar.gz<br />
cd nginx-0.7.64/<br />
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_ssl_module<br />
make<br />
make install<br />
cd ../</p></blockquote>
<p>最后安装spawn-fcgi,用来启动PHP的</p>
<blockquote><p>wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.gz<br />
tar -zxf spawn-fcgi-1.6.3.tar.gz<br />
cd spawn-fcgi-1.6.3<br />
./configure --bindir=/usr/bin --libdir=/usr/lib --prefix=/etc<br />
make&#038;&make install</p></blockquote>
<p>启动方法是</p>
<blockquote><p>/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 8 -u www -g www -f "/usr/bin/php5-cgi -d /var/www"<br />
/usr/local/nginx/sbin/nginx</p></blockquote>
<p>这只是一篇简单的记录日志,没有给出配置文件,配置文件用一键包的就OK,另外,我还没弄好开机启动 php 和 nginx 的脚本,所以每次都要手动运行.</p>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/" title="一步一步教你安装Nginx+PHP+Mysql">一步一步教你安装Nginx+PHP+Mysql</a> (56)</li><li><a href="http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/" title="最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包">最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包</a> (36)</li><li><a href="http://imcat.in/litespeed-mysql-php-install/" title="简单的llmp(Litespeed+mysql+php)安装教程">简单的llmp(Litespeed+mysql+php)安装教程</a> (17)</li><li><a href="http://imcat.in/suhosin-protect-your-php/" title="Suhosin &#8211; 保护你的PHP">Suhosin &#8211; 保护你的PHP</a> (10)</li><li><a href="http://imcat.in/wordpress-on-nginx-apache-mod_rewrite-enabled/" title="WordPress在Nginx中启用Apache的mod_rewrite">WordPress在Nginx中启用Apache的mod_rewrite</a> (6)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>安装apc为php加速</title>
		<link>http://imcat.in/apc-for-php-installed-to-speed-up/</link>
		<comments>http://imcat.in/apc-for-php-installed-to-speed-up/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 22:30:20 +0000</pubDate>
		<dc:creator>Cat.</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[APC]]></category>
		<category><![CDATA[install-apc]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://imcat.in/%e5%ae%89%e8%a3%85apc%e4%b8%baphp%e5%8a%a0%e9%80%9f/</guid>
		<description><![CDATA[Alternative PHP Cache（APC）是 PHP 的一个免费公开的优化代码缓存。它用来提供免费，公开并且强健的架构来缓存和优化 PHP 的中间代码。 主要是加速PHP.. WordPress是一个占用内存的大户,而且执行效率比较低.. 我安装了APC后,VPS的整体内存降了30M左右吧.. 下面是安装方法: wget http://pecl.php.net/get/APC-3.1.2.tgz tar zxvf APC-3.1.2.tgz cd APC-3.1.2/ /usr/local/php/bin/phpize ./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/php/bin/php-config make make install php.ini 查找extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/" 下面添加extension = "apc.so" 配置php.ini 末尾加入 apc.enabled = 1 apc.cache_by_default = on apc.shm_segments = 1 apc.shm_size = 32 apc.ttl = 600 apc.user_ttl = 600 apc.num_files_hint = [...]]]></description>
			<content:encoded><![CDATA[<p>Alternative PHP Cache（APC）是 PHP 的一个免费公开的优化代码缓存。它用来提供免费，公开并且强健的架构来缓存和优化 PHP 的中间代码。<br />
主要是加速PHP..<br />
WordPress是一个占用内存的大户,而且执行效率比较低..<br />
我安装了APC后,VPS的整体内存降了30M左右吧..<br />
下面是安装方法:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wget http://pecl.php.net/get/APC-3.1.2.tgz<br />
tar zxvf APC-3.1.2.tgz<br />
cd APC-3.1.2/<br />
/usr/local/php/bin/phpize<br />
./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/php/bin/php-config<br />
make<br />
make install</div></div>
<p><span id="more-1027"></span><br />
php.ini<br />
查找extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"<br />
下面添加extension = "apc.so" </p>
<p>配置php.ini 末尾加入<br />
apc.enabled = 1<br />
apc.cache_by_default = on<br />
apc.shm_segments = 1<br />
apc.shm_size = 32<br />
apc.ttl = 600<br />
apc.user_ttl = 600<br />
apc.num_files_hint = 0<br />
apc.write_lock = On</p>
<p>然后重启服务器就OK</p>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/suhosin-protect-your-php/" title="Suhosin &#8211; 保护你的PHP">Suhosin &#8211; 保护你的PHP</a> (10)</li><li><a href="http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/" title="最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包">最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包</a> (36)</li><li><a href="http://imcat.in/linux-tar-exclude/" title="Linux命令tar压缩排除指定目录的方法">Linux命令tar压缩排除指定目录的方法</a> (0)</li><li><a href="http://imcat.in/iptables-limit-number-connections-same-ip/" title="iptables限制同一IP连接数">iptables限制同一IP连接数</a> (3)</li><li><a href="http://imcat.in/linux-replace-the-file-name-space/" title="Linux下替换文件名中的空格">Linux下替换文件名中的空格</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/apc-for-php-installed-to-speed-up/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>最新Linux下的Nginx+MySQL+PHP+Memcache+Vsftpd一键安装包</title>
		<link>http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/</link>
		<comments>http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 08:07:28 +0000</pubDate>
		<dc:creator>Cat.</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[LNMP]]></category>
		<category><![CDATA[Memcache]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Vsftpd]]></category>

		<guid isPermaLink="false">http://imcat.in/%e6%9c%80%e6%96%b0linux%e4%b8%8b%e7%9a%84nginxmysqlphpmemcachevsftpd%e4%b8%80%e9%94%ae%e5%ae%89%e8%a3%85%e5%8c%85/</guid>
		<description><![CDATA[这个LANP安装包不是原创!是修改版! 我接触Linux也就一个多月而已,很多东西还是靠Google学来的!这个LANP安装包是我根据张宴和Licess的LNMP改写而成,而且经过我多次测试才发布的.测试环境为CentOS 4.0, CentOS 5.2, CentOS 5.3猫言猫语的VPS就是用这个安装包安装的.安装很简单,也就运行几个命令而已. 程序版本为: Nginx 0.7.60  PHP5.2.9  MySQL 5.1.35 1.首先登陆VPS,用SSH登陆. 2.安装LNMP,进入一个目录:cd /usr/local/src 然后就下载LNMP:wget http://imcat.in/LNMP.zip 解压缩 unzip LNMP.zip 有些VPS安装后没有unzip这个命令,那么运行 yum install unzip 进入该目录 cd LNMP 给脚本添加执行权限:chmod +x down.sh install.sh startup.sh 下载安装所需的源代码文件: ./down.sh 开始安装: ./install.sh 安装完后,请运行:passwd www 为www用户设置一个密码.这个用户和密码就是ftp的用户名和密码 修改您的MySQL的root密码 使用命令：mysqladmin -u root -p password mypasswd //mypasswd为自己的密码 如果提示没有mysqladmin命令.请运行:yum install mysql 这样你就可以上传你的网站了. 程序安装路径： MySQL : [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;">这个LANP安装包不是原创!是修改版!</span></p>
<p>我接触Linux也就一个多月而已,很多东西还是靠Google学来的!这个LANP安装包是我根据<a title="张宴的博客" href="http://blog.s135.com/" target="_blank">张宴</a>和<a title="Licess的博客" href="http://blog.licess.cn/lnmp/" target="_blank">Licess</a>的LNMP改写而成,而且经过我多次测试才发布的.测试环境为CentOS 4.0, CentOS 5.2, CentOS 5.3<a href="http://imcat.in/">猫言猫语</a>的VPS就是用这个安装包安装的.安装很简单,也就运行几个命令而已.</p>
<p>程序版本为: Nginx 0.7.60  PHP5.2.9  MySQL 5.1.35</p>
<p>1.首先登陆VPS,用SSH登陆.</p>
<p>2.安装LNMP,进入一个目录:cd /usr/local/src</p>
<p>然后就下载LNMP:wget http://imcat.in/LNMP.zip</p>
<p>解压缩 unzip LNMP.zip</p>
<p>有些VPS安装后没有unzip这个命令,那么运行 yum install unzip</p>
<p>进入该目录 cd LNMP</p>
<p>给脚本添加执行权限:chmod +x down.sh install.sh startup.sh</p>
<p>下载安装所需的源代码文件: ./down.sh</p>
<p>开始安装: ./install.sh</p>
<p>安装完后,请运行:passwd www</p>
<p>为www用户设置一个密码.这个用户和密码就是ftp的用户名和密码</p>
<p><span id="more-944"></span></p>
<p>修改您的MySQL的root密码<br />
使用命令：mysqladmin -u root -p password mypasswd          //mypasswd为自己的密码<br />
如果提示没有mysqladmin命令.请运行:yum install mysql</p>
<p>这样你就可以上传你的网站了.</p>
<p>程序安装路径：<br />
MySQL :   /usr/local/mysql<br />
PHP :     /usr/local/php<br />
Nginx :   /usr/local/nginx<br />
PHPMyAdmin /home/www/phpmyadmin<br />
Web目录    /home/www<br />
FTP根目录   /home/www</p>
<p>注意：MYSQL数据库用户名root密码root，登陆后进入mysql数据库，找到user表，删除除了有root密码外的所有用户。</p>
<p>另外:Linux系统要用32位的.64位占用的内存很大的.</p>
<blockquote><p><span style="color: #ff0000;">9月29日更新:更新Nginx 0.7.62  PHP5.2.10  MySQL 5.1.39 .删除APC缓存,因为和zend有冲突,改为用eaccelerator做PHP的缓存</p>
<p>7月21日更新:更新Nginx 0.7.61  PHP5.2.10  MySQL 5.1.35 添加APC缓存<br />
用我这个安装包是无法安装Zend的,因为Zend和APC有冲突,如果要安装的话,就要在PHP.INI里面取消APC才可以<br />
</span></p>
<p>9月29日更新:<a href="../lnmp.zip" target="_blank">http://imcat.in/lnmp.zip</a></p>
<p>7月21日更新:<a href="../LNMP.zip" target="_blank">http://imcat.in/LNMP.zip</a></p></blockquote>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/" title="一步一步教你安装Nginx+PHP+Mysql">一步一步教你安装Nginx+PHP+Mysql</a> (56)</li><li><a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/" title="debian安装nginx+php(spawn-fcgi)+mysql">debian安装nginx+php(spawn-fcgi)+mysql</a> (10)</li><li><a href="http://imcat.in/litespeed-mysql-php-install/" title="简单的llmp(Litespeed+mysql+php)安装教程">简单的llmp(Litespeed+mysql+php)安装教程</a> (17)</li><li><a href="http://imcat.in/lnmp-installation-package-upgrade-latest-version-nginx/" title="LNMP 一键安装包平滑升级 Nginx 到最新版本">LNMP 一键安装包平滑升级 Nginx 到最新版本</a> (10)</li><li><a href="http://imcat.in/suhosin-protect-your-php/" title="Suhosin &#8211; 保护你的PHP">Suhosin &#8211; 保护你的PHP</a> (10)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/the-latest-linux-under-nginx-mysql-php-memcache-vsftpd-one-click-installation-package/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>php5.2 的 php.ini 中文版</title>
		<link>http://imcat.in/chinese-version-of-the-phpini-php52/</link>
		<comments>http://imcat.in/chinese-version-of-the-phpini-php52/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 22:44:17 +0000</pubDate>
		<dc:creator>Cat.</dc:creator>
				<category><![CDATA[个人收藏]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php.ini]]></category>

		<guid isPermaLink="false">http://www.maoxmao.com/?p=455</guid>
		<description><![CDATA[php5.2 的 php.ini 中文版,本文并非是对英文版 php.ini 的简单翻译，而是参考了众多资料以后，结合自己的理解，增加了许多内容，]]></description>
			<content:encoded><![CDATA[<p>; 本文并非是对英文版 php.ini 的简单翻译，而是参考了众多资料以后，结合自己的理解，增加了许多内容，<br />
; 包括在原有 php.ini 基础上增加了一些实用模块的<span>配置</span>说明，同时对文件内容的安排进行了调整。<br />
; 由于作者不喜欢 no-free 的玩意儿，所以删除了除 MySQL 和 PostgreSQL 以外的其他数据库模块配置选项。<br />
;;;;;;;;;;;;;;;;;<br />
;; 关于php.ini ;;<br />
;;;;;;;;;;;;;;;;;<br />
; 这个文件必须命名为’php.ini’并放置在httpd.conf中的PHPIniDir指令指定的目录中。<br />
; 最新版本的php.ini可以在下面两个位置查看：<br />
; <a href="http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?view=co" target="_blank">http://cvs.php.net/viewvc.cgi/php-src/php.ini-recommended?view=co</a><br />
; <a href="http://cvs.php.net/viewvc.cgi/php-src/php.ini-dist?view=co" target="_blank">http://cvs.php.net/viewvc.cgi/php-src/php.ini-dist?view=co</a></p>
<p>;;;;;;;;;;;;<br />
;;   语法   ;;<br />
;;;;;;;;;;;;<br />
; 该文件的语法非常简单。空白字符和以分号开始的行被简单地忽略。<br />
; 章节标题(例如: [php])也被简单地忽略，即使将来它们可能有某种意义。<br />
<span id="more-455"></span>;<br />
; 设置指令的格式如下：<br />
; directive = value<br />
; 指令名(directive)是大小写敏感的！所以”foo=bar”不同于”FOO=bar”。<br />
; 值(value)可以是：<br />
; 1. 用引号界定的字符串(如：”foo”)<br />
; 2. 一个数字(整数或浮点数，如：0, 1, 34, -1, 33.55)<br />
; 3. 一个PHP常量(如：E_ALL, M_PI)<br />
; 4. 一个INI常量(On, Off, none)<br />
; 5. 一个表达式(如：E_ALL &amp; ~E_NOTICE)<br />
;<br />
; INI文件中的表达式仅使用：位运算符、逻辑非、圆括号：<br />
; | 位或<br />
; &amp; 位与<br />
; ~ 位非<br />
; ! 逻辑非<br />
;<br />
; 布尔标志用 On 表示打开，用 Off 表示关闭。<br />
;<br />
; 一个空字符串可以用在等号后不写任何东西表示，或者用 none 关键字：<br />
; foo =          ; 将foo设为空字符串<br />
; foo = none     ; 将foo设为空字符串<br />
; foo = “none”   ; 将foo设为字符串’none’<br />
;<br />
; 如果你在指令值中使用动态扩展(PHP扩展或Zend扩展)中的常量，<br />
; 那么你只能在加载这些动态扩展的指令行之后使用这些常量。</p>
<p>;;;;;;;;;;;;;;;;;;<br />
;;   httpd.conf   ;;<br />
;;;;;;;;;;;;;;;;;;<br />
; 还可以在httpd.conf中覆盖php.ini的值，以进行更灵活的配置：<br />
; php_value name value   ;设置非bool型的指令，将value设为none则清除先前的设定<br />
; php_flag   name on|off ;仅用于设置bool型的指令<br />
;<br />
; PHP常量(如E_ALL)仅能在php.ini中使用，在httpd.conf中必须使用相应的掩码值。<br />
; 带”SYS”标志的指令只能在httpd.conf中的全局配置部分使用，<br />
; 带”ini”标志的指令不能在httpd.conf中使用，它们仅能用于php.ini中。</p>
<p>;==========================================================================================<br />
;;=====================================配置指令详解========================================<br />
;==========================================================================================<br />
; 以下每个指令的设定值都与 PHP-5.2 内建的默认值相同。<br />
; 也就是说，如果’php.ini’不存在，或者你删掉了某些行，默认值与之相同。</p>
<p>;;;;;;;;;;;;;;<br />
;;   Apache   ;;<br />
;;;;;;;;;;;;;;<br />
[Apache]<br />
; 仅在将PHP作为Apache模块时才有效。</p>
<p>engine = On<br />
; 是否启用PHP解析引擎。<br />
; 可以在httpd.conf中基于目录或者虚拟主机来打开或者关闭PHP解析引擎。</p>
<p>last_modified = Off<br />
; 是否在Last-Modified应答头中放置该PHP脚本的最后修改时间。</p>
<p>xbithack = Off<br />
; 是否不管文件结尾是什么，都作为PHP可执行位组来解析。</p>
<p>child_terminate = Off<br />
; PHP脚本在请求结束后是否允许使用apache_child_terminate()函数终止子进程。<br />
; 该指令仅在UNIX平台上将PHP安装为Apache1.3的模块时可用。其他情况下皆不存在。</p>
<p>;;;;;;;;;;;;;;;<br />
;;   PHP核心   ;;<br />
;;;;;;;;;;;;;;;</p>
<p>[PHP-Core-DateTime]<br />
; 前四个配置选项目前仅用于date_sunrise()和date_sunset()函数。</p>
<p>date.default_latitude = 31.7667<br />
; 默认纬度</p>
<p>date.default_longitude = 35.2333<br />
; 默认经度</p>
<p>date.sunrise_zenith = 90.583333<br />
; 默认日出天顶</p>
<p>date.sunset_zenith = 90.583333<br />
; 默认日落天顶</p>
<p>date.timezone =<br />
; 未设定TZ环境变量时用于所有日期和时间函数的默认时区。<br />
; 中国大陆应当使用”PRC”<br />
; 应用时区的优先顺序为：<br />
; 1. 用date_default_timezone_set()函数设定的时区(如果设定了的话)<br />
; 2. TZ 环境变量(如果非空的话)<br />
; 3. 该指令的值(如果设定了的话)<br />
; 4. PHP自己推测(如果操作系统支持)<br />
; 5. 如果以上都不成功，则使用 UTC</p>
<p>[PHP-Core-Assert]</p>
<p>assert.active = On<br />
; 是否启用assert()断言评估</p>
<p>assert.bail = Off<br />
; 是否在发生失败断言时中止脚本的执行</p>
<p>assert.callback =<br />
; 发生失败断言时执行的回调函数</p>
<p>assert.quiet_eval = Off<br />
; 是否使用安静评估(不显示任何错误信息，相当于error_reporting=0)。<br />
; 若关闭则在评估断言表达式的时候使用当前的error_reporting指令值。</p>
<p>assert.warning = On<br />
; 是否对每个失败断言都发出警告</p>
<p>[PHP-Core-SafeMode]<br />
; 安全模式是为了解决共享<span>服务器</span>的安全问题而设立的。<br />
; 但试图在PHP层解决这个问题在结构上是不合理的，<br />
; 正确的做法应当是修改web服务器层和操作系统层。<br />
; 因此在PHP6中废除了安全模式，并打算使用open_basedir指令取代之。</p>
<p>safe_mode = Off<br />
;SYS<br />
; 是否启用安全模式。<br />
; 打开时，PHP将检查当前脚本的拥有者是否和被操作的文件的拥有者相同，<br />
; 相同则允许操作，不同则拒绝操作。</p>
<p>safe_mode_gid = Off<br />
;SYS<br />
; 在安全模式下，默认在访问文件时会做UID比较检查。<br />
; 但有些情况下严格的UID检查反而是不适合的，宽松的GID检查已经足够。<br />
; 如果你想将其放宽到仅做GID比较，可以打开这个参数。</p>
<p>safe_mode_allowed_env_vars = “PHP_”<br />
;SYS<br />
; 在安全模式下，用户仅可以更改的环境变量的前缀列表(逗号分隔)。<br />
; 允许用户设置某些环境变量，可能会导致潜在的安全漏洞。<br />
; 注意: 如果这一参数值为空，PHP将允许用户更改任意环境变量！</p>
<p>safe_mode_protected_env_vars = “LD_LIBRARY_PATH”<br />
;SYS<br />
; 在安全模式下，用户不能更改的环境变量列表(逗号分隔)。<br />
; 这些变量即使在safe_mode_allowed_env_vars指令设置为允许的情况下也会得到保护。</p>
<p>safe_mode_exec_dir = “/usr/local/php/bin”<br />
;SYS<br />
; 在安全模式下，只有该目录下的可执行程序才允许被执行系统程序的函数执行。<br />
; 这些函数是：system, escapeshellarg, escapeshellcmd, exec, passthru,<br />
; proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, shell_exec</p>
<p>safe_mode_include_dir =<br />
;SYS<br />
; 在安全模式下，该组目录和其子目录下的文件被包含时，将跳过UID/GID检查。<br />
; 换句话说，如果此处的值为空，任何UID/GID不符合的文件都不允许被包含。<br />
; 这里设置的目录必须已经存在于include_path指令中或者用完整路径来包含。<br />
; 多个目录之间用冒号(Win下为分号)隔开。<br />
; 指定的限制实际上是一个前缀，而非一个目录名，<br />
; 也就是说”/dir/incl”将允许访问”/dir/include”和”/dir/incls”<br />
; 如果您希望将访问控制在一个指定的目录，那么请在结尾加上斜线。</p>
<p>sql.safe_mode = Off<br />
;SYS<br />
; 是否使用SQL安全模式。<br />
; 如果打开，指定默认值的数据库连接函数将会使用这些默认值代替支持的参数。<br />
; 对于每个不同数据库的连接函数，其默认值请参考相应的手册页面。</p>
<p>[PHP-Core-Safe]</p>
<p>allow_url_fopen = On<br />
;ini<br />
; 是否允许打开远程文件</p>
<p>allow_url_include = Off<br />
;SYS<br />
; 是否允许include/require远程文件。</p>
<p>disable_classes =<br />
;ini<br />
; 该指令接受一个用逗号分隔的类名列表，以禁用特定的类。</p>
<p>disable_functions =<br />
;ini<br />
; 该指令接受一个用逗号分隔的函数名列表，以禁用特定的函数。</p>
<p>enable_dl = On<br />
;SYS<br />
; 是否允许使用dl()函数。dl()函数仅在将PHP作为apache模块安装时才有效。<br />
; 禁用dl()函数主要是出于安全考虑，因为它可以绕过open_basedir指令的限制。<br />
; 在安全模式下始终禁用dl()函数，而不管此处如何设置。</p>
<p>expose_php = On<br />
;ini<br />
; 是否暴露PHP被安装在服务器上的事实(在http头中加上其签名)。<br />
; 它不会有安全上的直接威胁，但它使得客户端知道服务器上安装了PHP。</p>
<p>open_basedir =<br />
;SYS<br />
; 将PHP允许操作的所有文件(包括文件自身)都限制在此组目录列表下。<br />
error_prepend_string =   ;”&lt;font color=#f00&gt;”<br />
; 用于错误信息前输出的字符串<br />
error_append_string =    ;”&lt;/font&gt;”<br />
; 用于错误信息后输出的字符串</p>
<p>xmlrpc_errors = Off<br />
xmlrpc_error_number = 0<br />
; 尚无文档</p>
<p>[PHP-Core-Logging]</p>
<p>define_syslog_variables = Off<br />
; 是否定义各种系统日志变量，如：$LOG_PID, $LOG_CRON 等等。<br />
; 关掉它以提高效率的好主意。<br />
; 你可以在运行时调用define_syslog_variables()函数来定义这些变量。</p>
<p>error_log =<br />
; 将错误日志记录到哪个文件中。该文件必须对Web服务器用户可写。<br />
; syslog 表示记录到系统日志中(NT下的事件日志, Unix下的syslog(3))<br />
; 如果此处未设置任何值，则错误将被记录到Web服务器的错误日志中。</p>
<p>log_errors = Off<br />
; 是否在日志文件里记录错误，具体在哪里记录取决于error_log指令。<br />
; 强烈建议你在最终发布的web站点时使用日志记录错误而不是直接输出，<br />
; 这样可以让你既知道那里出了问题，又不会暴露敏感信息。</p>
<p>log_errors_max_len = 1024<br />
; 设置错误日志中附加的与错误信息相关联的错误源的最大长度。<br />
; 这里设置的值对显示的和记录的错误以及$php_errormsg都有效。<br />
; 设为 0 可以允许无限长度。</p>
<p>ignore_repeated_errors = Off<br />
; 记录错误日志时是否忽略重复的错误信息。<br />
; 错误信息必须出现在同一文件的同一行才被被视为重复。</p>
<p>ignore_repeated_source = Off<br />
; 是否在忽略重复的错误信息时忽略重复的错误源。</p>
<p>[PHP-Core-Mail]<br />
; 要使邮件函数可用，PHP必须在编译时能够访问sendmail程序。<br />
; 如果使用其它的邮件程序，如qmail或postfix，确保使用了相应的sendmail包装。<br />
; PHP首先会在系统的PATH环境变量中搜索sendmail，接着按以下顺序搜索：<br />
; /usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib<br />
; 强烈建议在PATH中能够找到sendmail。<br />
; 另外，编译PHP的用户必须能够访问sendmail程序。</p>
<p>SMTP = “localhost”<br />
; mail()函数中用来发送邮件的SMTP服务器的主机名称或者IP地址。仅用于win32。</p>
<p>smtp_port = 25<br />
; SMTP服务器的端口号。仅用于win32。</p>
<p>sendmail_from =<br />
; 发送邮件时使用的”From:”头中的邮件地址。仅用于win32<br />
; 该选项还同时设置了”Return-Path:”头。</p>
<p>sendmail_path = “-t -i”<br />
;SYS<br />
; 仅用于unix，也可支持参数(默认的是’sendmail -t -i’)<br />
; sendmail程序的路径，通常为”/usr/sbin/sendmail或/usr/lib/sendmail”。<br />
; configure脚本会尝试找到该程序并设定为默认值，但是如果失败的话，可以在这里设定。<br />
; 不使用sendmail的系统应将此指令设定为sendmail替代程序(如果有的话)。<br />
; 例如，Qmail用户通常可以设为”/var/qmail/bin/sendmail”或”/var/qmail/bin/qmail-inject”。<br />
; qmail-inject 不需要任何选项就能正确处理邮件。</p>
<p>mail.force_extra_parameters =<br />
; 作为额外的参数传递给sendmail库的强制指定的参数附加值。<br />
; 这些参数总是会替换掉mail()的第5个参数，即使在安全模式下也是如此。</p>
<p>[PHP-Core-ResourceLimit]</p>
<p>default_socket_timeout = 60<br />
; 默认socket超时(秒)</p>
<p>max_execution_time = 30<br />
; 每个脚本最大允许执行时间(秒)，0 表示没有限制。<br />
; 这个参数有助于阻止劣质脚本无休止的占用服务器资源。<br />
; 该指令仅影响脚本本身的运行时间，任何其它花费在脚本运行之外的时间，<br />
; 如用system()/sleep()函数的使用、数据库查询、文件上传等，都不包括在内。<br />
; 在安全模式下，你不能用ini_set()在运行时改变这个设置。</p>
<p>memory_limit = 16M<br />
; 一个脚本所能够申请到的最大内存字节数(可以使用K和M作为单位)。<br />
; 这有助于防止劣质脚本消耗完服务器上的所有内存。<br />
; 要能够使用该指令必须在编译时使用”–enable-memory-limit”配置选项。<br />
; 如果要取消内存限制，则必须将其设为 -1 。<br />
; 设置了该指令后，memory_get_usage()函数将变为可用。</p>
<p>max_input_time = -1<br />
; 每个脚本解析输入数据(POST, GET, upload)的最大允许时间(秒)。<br />
; -1 表示不限制。</p>
<p>post_max_size = 8M<br />
; 允许的POST数据最大字节长度。此设定也影响到文件上传。<br />
; 如果POST数据超出限制，那么___FCKpd___0</p>
<p>POST和<br />
___FCKpd___0</p>
<p>FILES将会为空。<br />
; 要上传大文件，该值必须大于upload_max_filesize指令的值。<br />
; 如果启用了内存限制，那么该值应当小于memory_limit指令的值。</p>
<p>realpath_cache_size = 16K<br />
;SYS<br />
; 指定PHP使用的realpath(规范化的绝对路径名)缓冲区大小。<br />
; 在PHP打开大量文件的系统上应当增大该值以提高性能。</p>
<p>realpath_cache_ttl = 120<br />
;SYS<br />
; realpath缓冲区中信息的有效期(秒)。<br />
; 对文件很少变动的系统，可以增大该值以提高性能。</p>
<p>[PHP-Core-FileUpLoad]</p>
<p>file_uploads = On<br />
;SYS<br />
; 是否允许HTTP文件上传。<br />
; 参见upload_max_filesize, upload_tmp_dir, post_max_size指令</p>
<p>upload_max_filesize = 2M<br />
; 允许上传的文件的最大尺寸。</p>
<p>upload_tmp_dir =<br />
;SYS<br />
; 文件上传时存放文件的临时目录(必须是PHP进程用户可写的目录)。<br />
; 如果未指定则PHP使用系统默认的临时目录。</p>
<p>[PHP-Core-MagicQuotes]<br />
; PHP6将取消魔术引号，相当于下列指令全部为 Off</p>
<p>magic_quotes_gpc = On<br />
; 是否对输入的GET/POST/Cookie数据使用自动字符串转义( ‘   ”      NULL )。<br />
; 这里的设置将自动影响<br />
___FCKpd___0</p>
<p>GEST<br />
___FCKpd___0</p>
<p>POST<br />
___FCKpd___0</p>
<p>COOKIE 数组的值。<br />
; 若将本指令与magic_quotes_sybase指令同时打开，则仅将单引号(’)转义为(”)，<br />
; 其它特殊字符将不被转义，即( ”      NULL )将保持原样！！<br />
; 建议关闭此特性，并使用自定义的过滤函数。</p>
<p>magic_quotes_runtime = Off<br />
; 是否对运行时从外部资源产生的数据使用自动字符串转义( ‘   ”      NULL )。<br />
; 若打开本指令，则大多数函数从外部资源(数据库,文本文件等)返回数据都将被转义。<br />
; 例如：用SQL查询得到的数据，用exec()函数得到的数据，等等<br />
; 若将本指令与magic_quotes_sybase指令同时打开，则仅将单引号(’)转义为(”)，<br />
; 其它特殊字符将不被转义，即( ”      NULL )将保持原样！！<br />
; 建议关闭此特性，并视具体情况使用自定义的过滤函数。</p>
<p>magic_quotes_sybase = Off<br />
; 是否采用Sybase形式的自动字符串转义(用 ” 表示 ‘)</p>
<p>[PHP-Core-HighLight]</p>
<p>highlight.bg = “#FFFFFF”<br />
highlight.comment = “#FF8000″<br />
highlight.default = “#0000BB”<br />
highlight.html = “#000000″<br />
highlight.keyword = “#007700″<br />
highlight.string = “#DD0000″<br />
; 语法高亮模式的色彩(通常用于显示 .phps 文件)。<br />
; 只要能被&lt;font color=xxx&gt;接受的东西就能正常工作。</p>
<p>[PHP-Core-Langue]</p>
<p>short_open_tag = On<br />
; 是否允许使用”&lt;? ?&gt;”短标识。否则必须使用”&lt;?php ?&gt;”长标识。<br />
; 除非你的php程序仅在受控环境下运行，且只供自己使用，否则请不要使用短标记。<br />
; 如果要和XML结合使用PHP，可以选择关闭此选项以方便直接嵌入”&lt;?xml … ?&gt;”，<br />
; 不然你必须用PHP来输出：&lt;? echo ‘&lt;?xml version=”1.0″‘; ?&gt;<br />
; 本指令也会影响到缩写形式”&lt;?=”，它和”&lt;? echo”等价，要使用它也必须打开短标记。</p>
<p>asp_tags = Off<br />
; 是否允许ASP风格的标记”&lt;% %&gt;”，这也会影响到缩写形式”&lt;%=”。<br />
; PHP6中将删除此指令</p>
<p>arg_separator.output = “&amp;”<br />
; PHP所产生的URL中用来分隔参数的分隔符。<br />
; 另外还可以用”&amp;”或”,”或者”&amp;amp;”等等。</p>
<p>arg_separator.input = “&amp;”<br />
; PHP解析URL中的变量时使用的分隔符列表。<br />
; 字符串中的每一个字符都会被当作分割符。<br />
; 另外还可以用”,&amp;”等等。</p>
<p>allow_call_time_pass_reference = On<br />
; 是否强迫在函数调用时按引用传递参数(每次使用此特性都会收到一条警告)。<br />
; php反对这种做法，并在将来的版本里不再支持，因为它影响到了代码的整洁。<br />
; 鼓励的方法是在函数声明里明确指定哪些参数按引用传递。<br />
; 我们鼓励你关闭这一选项，以保证你的脚本在将来版本的语言里仍能正常工作。<br />
auto_globals_jit = On<br />
; 是否仅在使用到<br />
___FCKpd___0</p>
<p>SERVER和<br />
___FCKpd___0</p>
<p>ENV变量时才创建(而不是在脚本一启动时就自动创建)。<br />
; 如果并未在脚本中使用这两个数组，打开该指令将会获得性能上的提升。<br />
; 要想该指令生效，必须关闭register_globals和register_long_arrays指令。</p>
<p>auto_prepend_file =<br />
auto_append_file   =<br />
; 指定在主文件之前/后自动解析的文件名。为空表示禁用该特性。<br />
; 该文件就像调用了include()函数被包含进来一样，因此会使用include_path指令的值。<br />
; 注意：如果脚本通过exit()终止，那么自动后缀将不会发生。</p>
<p>variables_order = “EGPCS”<br />
; PHP注册 Environment, GET, POST, Cookie, Server 变量的顺序。<br />
; 分别用 E, G, P, C, S 表示，按从左到右注册，新值覆盖旧值。<br />
; 举例说，设为”GP”将会导致用POST变量覆盖同名的GET变量，<br />
; 并完全忽略 Environment, Cookie, Server 变量。<br />
; 推荐使用”GPC”或”GPCS”，并使用getenv()函数访问环境变量。</p>
<p>register_globals = Off<br />
; 是否将 E, G, P, C, S 变量注册为全局变量。<br />
; 打开该指令可能会导致严重的安全问题，除非你的脚本经过非常仔细的检查。<br />
; 推荐使用预定义的超全局变量：<br />
___FCKpd___0</p>
<p>ENV,<br />
___FCKpd___0</p>
<p>GET,<br />
___FCKpd___0</p>
<p>POST,<br />
___FCKpd___0</p>
<p>COOKIE,<br />
___FCKpd___0</p>
<p>SERVER<br />
; 该指令受variables_order指令的影响。<br />
; PHP6中已经删除此指令。</p>
<p>register_argc_argv = On<br />
; 是否声明$argv和$argc全局变量(包含用GET方法的信息)。<br />
; 建议不要使用这两个变量，并关掉该指令以提高性能。</p>
<p>register_long_arrays = On<br />
; 是否启用旧式的长式数组(HTTP_*_VARS)。<br />
; 鼓励使用短式的预定义超全局数组，并关闭该特性以获得更好的性能。<br />
; PHP6中已经删除此指令。</p>
<p>always_populate_raw_post_data = Off<br />
; 是否总是生成$HTTP_RAW_POST_DATA变量(原始POST数据)。<br />
; 否则，此变量仅在遇到不能识别的MIME类型的数据时才产生。<br />
; 不过，访问原始POST数据的更好方法是 php://input 。<br />
; $HTTP_RAW_POST_DATA对于enctype=”multipart/form-data”的表单数据不可用。</p>
<p>unserialize_callback_func =<br />
; 如果解序列化处理器需要实例化一个未定义的类，<br />
; 这里指定的回调函数将以该未定义类的名字作为参数被unserialize()调用，<br />
; 以免得到不完整的”__PHP_Incomplete_Class”对象。<br />
; 如果这里没有指定函数，或指定的函数不包含(或实现)那个未定义的类，将会显示警告信息。<br />
; 所以仅在确实需要实现这样的回调函数时才设置该指令。<br />
; 若要禁止这个特性，只需置空即可。</p>
<p>y2k_compliance = On<br />
; 是否强制打开2000年适应(可能在非Y2K适应的浏览器中导致问题)。</p>
<p>zend.ze1_compatibility_mode = Off<br />
; 是否使用兼容Zend引擎I(PHP 4.x)的模式。<br />
; 这将影响对象的复制、构造(无属性的对象会产生FALSE或0)、比较。<br />
; 兼容模式下，对象将按值传递，而不是默认的按引用传递。</p>
<p>precision = 14<br />
; 浮点型数据显示的有效位数。</p>
<p>serialize_precision = 100<br />
; 将浮点型和双精度型数据序列化存储时的精度(有效位数)。<br />
; 默认值能够确保浮点型数据被解序列化程序解码时不会丢失数据。</p>
<p>[PHP-Core-OutputControl]<br />
; 输出控制函数很有用，特别是在已经输出了信息之后再发送HTTP头的情况下。<br />
; 输出控制函数不会作用于header()或setcookie()等函数发送的HTTP头，<br />
; 而只会影响类似于echo()函数输出的信息和嵌入在PHP代码之间的信息。</p>
<p>implicit_flush = Off<br />
; 是否要求PHP输出层在每个输出块之后自动刷新数据。<br />
; 这等效于在每个 print()、echo()、HTML块 之后自动调用flush()函数。<br />
; 打开这个选项对程序执行的性能有严重的影响，通常只推荐在调试时使用。<br />
; 在CLI SAPI的执行模式下，该指令默认为 On 。</p>
<p>output_buffering = 0<br />
; 输出缓冲区大小(字节)。建议值为4096~8192。<br />
; 输出缓冲允许你甚至在输出正文内容之后再发送HTTP头(包括cookies)。<br />
; 其代价是输出层减慢一点点速度。<br />
; 设置输出缓冲可以减少写入，有时还能减少网络数据包的发送。<br />
; 这个参数的实际收益很大程度上取决于你使用的是什么Web服务器以及什么样的脚本。</p>
<p>output_handler =<br />
; 将所有脚本的输出重定向到一个输出处理函数。<br />
; 比如，重定向到mb_output_handler()函数时，字符编码将被透明地转换为指定的编码。<br />
; 一旦你在这里指定了输出处理程序，输出缓冲将被自动打开(output_buffering=4096)。<br />
; 注意0: 此处仅能使用PHP内置的函数，自定义函数应在脚本中使用ob_start()指定。<br />
; 注意1: 可移植脚本不能依赖该指令，而应使用ob_start()函数明确指定输出处理函数。<br />
;         使用这个指令可能会导致某些你不熟悉的脚本出错。<br />
; 注意2: 你不能同时使用”mb_output_handler”和”ob_iconv_handler”两个输出处理函数。<br />
;         你也不能同时使用”ob_gzhandler”输出处理函数和zlib.output_compression指令。<br />
; 注意3: 如果使用zlib.output_handler指令开启zlib输出压缩，该指令必须为空。</p>
<h2  class="related_post_title">暧味日志</h2><ul class="related_post"><li><a href="http://imcat.in/litespeed-mysql-php-install/" title="简单的llmp(Litespeed+mysql+php)安装教程">简单的llmp(Litespeed+mysql+php)安装教程</a> (17)</li><li><a href="http://imcat.in/teach-you-step-by-step-install-nginx-php-mysql/" title="一步一步教你安装Nginx+PHP+Mysql">一步一步教你安装Nginx+PHP+Mysql</a> (56)</li><li><a href="http://imcat.in/suhosin-protect-your-php/" title="Suhosin &#8211; 保护你的PHP">Suhosin &#8211; 保护你的PHP</a> (10)</li><li><a href="http://imcat.in/debian-install-nginx-php-spawn-fcgi-mysql/" title="debian安装nginx+php(spawn-fcgi)+mysql">debian安装nginx+php(spawn-fcgi)+mysql</a> (10)</li><li><a href="http://imcat.in/apc-for-php-installed-to-speed-up/" title="安装apc为php加速">安装apc为php加速</a> (14)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://imcat.in/chinese-version-of-the-phpini-php52/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

