<?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>baalchina &#187; PHP</title>
	<atom:link href="http://www.baalchina.net/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.baalchina.net</link>
	<description>baalchina技术日志</description>
	<lastBuildDate>Tue, 27 Sep 2011 07:12:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>升级Apache+PHP</title>
		<link>http://www.baalchina.net/2009/10/upgrade-php-apache/</link>
		<comments>http://www.baalchina.net/2009/10/upgrade-php-apache/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 05:26:47 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.baalchina.net/2009/10/upgrade-php-apache/</guid>
		<description><![CDATA[招生的时候检测报告说俺们的web server有漏洞，于是决定把Apache+PHP升级一下。
首先看一下版本：
[root@www1 ~]# /usr/local/apache2/bin/apachectl -v      Server version: Apache/2.2.4 (Unix)       Server built:&#160;&#160; Aug&#160; 7 2008 14:07:37

&#160;
php的版本可以写个phpinfo看到。装的是4.4.4。
&#160;
[root@www1 ~]# /usr/local/php/bin/php -i &#124;grep configure      Configure Command =&#62;&#160; './configure' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-zlib-dir' '--with-bz2' '--with-tiff-dir' '--with-gd=/usr/local/gd2' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-ttf' '--enable-mbstring' '--with-mysql=/usr/local/mysql' '--with-config-file-path=/etc' '--disable-ipv6' '--enable-static'
&#160;

&#160;
更多内容参照：http://www.baalchina.net/2009/08/php-mysql-apache-configure/
注意：

ZO也要装 [...]]]></description>
			<content:encoded><![CDATA[<p>招生的时候检测报告说俺们的web server有漏洞，于是决定把Apache+PHP升级一下。</p>
<p>首先看一下版本：</p>
<blockquote><p>[root@www1 ~]# /usr/local/apache2/bin/apachectl -v      <br />Server version: Apache/2.2.4 (Unix)       <br />Server built:&#160;&#160; Aug&#160; 7 2008 14:07:37</p>
</blockquote>
<p>&#160;</p>
<p>php的版本可以写个phpinfo看到。装的是4.4.4。</p>
<p>&#160;</p>
<blockquote><p>[root@www1 ~]# /usr/local/php/bin/php -i |grep configure      <br />Configure Command =&gt;&#160; './configure' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-zlib-dir' '--with-bz2' '--with-tiff-dir' '--with-gd=/usr/local/gd2' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-ttf' '--enable-mbstring' '--with-mysql=/usr/local/mysql' '--with-config-file-path=/etc' '--disable-ipv6' '--enable-static'</p>
<p>&#160;</p>
</blockquote>
<p>&#160;</p>
<p>更多内容参照：<a href="http://www.baalchina.net/2009/08/php-mysql-apache-configure/">http://www.baalchina.net/2009/08/php-mysql-apache-configure/</a></p>
<p>注意：</p>
<ul>
<li>ZO也要装 </li>
<li>根据跑的cms程序，php升级的时候尤其是4~5切记不可太随意。不过php4在07年就停止支持了… </li>
<li>备份好conf文件，虽然一般不会有问题…<br />
<h3>
<ul></ul>
<ul>先搞php</ul>
</h3>
<blockquote><p>wget <a href="http://cn2.php.net/get/php-5.2.11.tar.gz/from/cn.php.net/mirror">http://cn2.php.net/get/php-5.2.11.tar.gz/from/cn.php.net/mirror</a>           <br />tar xvzf php-5.2.11.tar.gz           <br />cd php-5.2.11           <br />'./configure' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-zlib-dir' '--with-bz2' '--with-tiff-dir' '--with-gd=/usr/local/gd2' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-ttf' '--enable-mbstring' '--with-mysql=/usr/local/mysql' '--with-config-file-path=/etc' '--disable-ipv6' '--enable-static'           <br />make;make install</p>
</blockquote>
</li>
</ul>
<h3>然后搞ZO</h3>
<p>&#160;</p>
<p>没啥好说的…bs Zend，居然要注册才给地址</p>
<p><a href="http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz">http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-i386.tar.gz</a></p>
<p>另外暂时不支持php5.3.0。</p>
<p>&#160;</p>
<h3>然后搞Apache:</h3>
<p>&#160;</p>
<blockquote><p>[root@www1 ~]# ./configure &quot;--prefix=/usr/local/apache2&quot; &quot;--enable-module=so&quot; &quot;--enable-deflate=shared&quot; &quot;--enable-expires=shared&quot; &quot;--enable-rewrite=&quot; &quot;--enable-static-support&quot; &quot;--enable-static-htpasswd&quot; &quot;--enable-static-htdigest&quot; &quot;--enable-static-rotatelogs&quot; &quot;--enable-static-logresolve&quot; &quot;--enable-static-htdbm&quot; &quot;--enable-static-ab&quot; &quot;--enable-static-checkgid&quot; &quot;--enable-ssl&quot; &quot;--disable-userdir&quot; &quot;--with-ssl=/usr/local/openssl&quot; &quot;--with-apr=/usr/local/apr&quot; &quot;--with-apr-util=/usr/local/apr-util/bin&quot;      <br />[root@www1 ~]# make;make install       <br />[root@www1 ~]# /usr/local/apache2/bin/apachectl stop       <br />[root@www1 ~]# /usr/local/apache2/bin/apachectl start       <br />[root@www1 ~]# /usr/local/apache2/bin/apachectl -v</p>
</blockquote>
<p>&#160;</p>
<p>打完收工。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2009/10/upgrade-php-apache/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>查看apache,php,mysql编译参数</title>
		<link>http://www.baalchina.net/2009/08/php-mysql-apache-configure/</link>
		<comments>http://www.baalchina.net/2009/08/php-mysql-apache-configure/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 02:36:54 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Mysql]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.baalchina.net/2009/08/php-mysql-apache-configure/</guid>
		<description><![CDATA[查看mysql编译参数：
cat /usr/local/mysql/bin/mysqlbug &#124; grep CONFIGURE_LINE 

查看apache编译参数：
cat $apachehome$/build/config.nice 

&#160;
也可以用
httpd –l

或者
httpd -v

查看php编译参数：
$PHP$/bin/php -i &#124; grep configure

&#160;
当然，写个phpinfo也是可以的。
&#60;?php phpinfo();?&#62;

]]></description>
			<content:encoded><![CDATA[<h2>查看mysql编译参数：</h2>
<blockquote><p>cat /usr/local/mysql/bin/mysqlbug | grep CONFIGURE_LINE </p>
</blockquote>
<h2>查看apache编译参数：</h2>
<blockquote><p>cat $apachehome$/build/config.nice </p>
</blockquote>
<p>&#160;</p>
<p>也可以用</p>
<blockquote><p>httpd –l</p>
</blockquote>
<p>或者</p>
<blockquote><p>httpd -v</p>
</blockquote>
<h2>查看php编译参数：</h2>
<blockquote><p>$PHP$/bin/php -i | grep configure</p>
</blockquote>
<p>&#160;</p>
<p>当然，写个phpinfo也是可以的。</p>
<blockquote><p>&lt;?php phpinfo();?&gt;</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2009/08/php-mysql-apache-configure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CentOS下的PHP安全</title>
		<link>http://www.baalchina.net/2008/08/centos%e4%b8%8b%e7%9a%84php%e5%ae%89%e5%85%a8/</link>
		<comments>http://www.baalchina.net/2008/08/centos%e4%b8%8b%e7%9a%84php%e5%ae%89%e5%85%a8/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 11:50:15 +0000</pubDate>
		<dc:creator>baalchina</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[安全]]></category>

		<guid isPermaLink="false">http://baalchina.nau.edu.cn/?p=30</guid>
		<description><![CDATA[打造安全的CENTOS服务器---php安全
2008-08-05 22:11:13 来源:中国站长站 作者:编辑整理 【大 中 小】 评论：0 条
http://www.chinaz.com/Server/Safe/0P534HR008.html
软件配置：
httpd-2.0.52-28.ent.centos4
php-4.3.9-3.15
1、开启安全模式（做为商业应用的服务器不建议开启）
复制内容到剪贴板
代码:

?View Code BASH#vi /usr/local/Zend/etc/php.ini            (没装ZO时php.ini文件位置为：/etc/php.ini)
&#160;
safe_mode = On

2、锁定PHP程序应用目录
复制内容到剪贴板
代码:

?View Code BASH#vi /etc tpd/conf.d irtualhost.conf

加入

php_admin_value open_basedir /home/*** （***为站点目录）

3、千万不要给不必要的目录给写权限，也就是777权限，根目录保持为711权限，如果不能运行PHP请改为755
4、屏蔽PHP不安全的参数(webshell)
复制内容到剪贴板
代码:

?View Code BASH&#160;
#vi /usr/local/Zend/etc/php.ini           (没装ZO时php.ini文件位置为：/etc/php.ini)
&#160;
disable_functions = system,exec,shell_exec,passthru,popen

以下为我的服务器屏蔽参数：

?View Code PHP&#160;
disable_functions = passthru,exec,shell_exec,system,set_time_limit,ini_alter,dl,
&#160;
pfsockopen,openlog,syslog,readlink,symlink,link,leak,fsockopen,popen,escapeshell
&#160;
cmd,error_log

]]></description>
			<content:encoded><![CDATA[<p>打造安全的CENTOS服务器---php安全<br />
2008-08-05 22:11:13 来源:中国站长站 作者:编辑整理 【大 中 小】 评论：0 条<br />
<a href="http://www.chinaz.com/Server/Safe/0P534HR008.html">http://www.chinaz.com/Server/Safe/0P534HR008.html</a></p>
<p>软件配置：</p>
<p>httpd-2.0.52-28.ent.centos4</p>
<p>php-4.3.9-3.15</p>
<p>1、开启安全模式（做为商业应用的服务器不建议开启）</p>
<p>复制内容到剪贴板</p>
<p>代码:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p30code5'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p305"><td class="code" id="p30code5"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#vi /usr/local/Zend/etc/php.ini            (没装ZO时php.ini文件位置为：/etc/php.ini)</span>
&nbsp;
safe_mode = On</pre></td></tr></table></div>

<p>2、锁定PHP程序应用目录</p>
<p>复制内容到剪贴板</p>
<p>代码:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p30code6'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p306"><td class="code" id="p30code6"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#vi /etc tpd/conf.d irtualhost.conf</span></pre></td></tr></table></div>

<p>加入</p>
<pre>
php_admin_value open_basedir /home/*** （***为站点目录）
</pre>
<p>3、千万不要给不必要的目录给写权限，也就是777权限，根目录保持为711权限，如果不能运行PHP请改为755</p>
<p>4、屏蔽PHP不安全的参数(webshell)</p>
<p>复制内容到剪贴板</p>
<p>代码:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p30code7'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p307"><td class="code" id="p30code7"><pre class="bash" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">#vi /usr/local/Zend/etc/php.ini           (没装ZO时php.ini文件位置为：/etc/php.ini)</span>
&nbsp;
disable_functions = system,<span style="color: #7a0874; font-weight: bold;">exec</span>,shell_exec,passthru,popen</pre></td></tr></table></div>

<p>以下为我的服务器屏蔽参数：</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p30code8'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table width="100%" ><tr id="p308"><td class="code" id="p30code8"><pre class="php" style="font-family:monospace;">&nbsp;
disable_functions <span style="color: #339933;">=</span> <a href="http://www.php.net/passthru"><span style="color: #990000;">passthru</span></a><span style="color: #339933;">,</span><a href="http://www.php.net/exec"><span style="color: #990000;">exec</span></a><span style="color: #339933;">,</span><a href="http://www.php.net/shell_exec"><span style="color: #990000;">shell_exec</span></a><span style="color: #339933;">,</span><a href="http://www.php.net/system"><span style="color: #990000;">system</span></a><span style="color: #339933;">,</span><a href="http://www.php.net/set_time_limit"><span style="color: #990000;">set_time_limit</span></a><span style="color: #339933;">,</span><a href="http://www.php.net/ini_alter"><span style="color: #990000;">ini_alter</span></a><span style="color: #339933;">,</span><a href="http://www.php.net/dl"><span style="color: #990000;">dl</span></a><span style="color: #339933;">,</span>
&nbsp;
<a href="http://www.php.net/pfsockopen"><span style="color: #990000;">pfsockopen</span></a><span style="color: #339933;">,</span><a href="http://www.php.net/openlog"><span style="color: #990000;">openlog</span></a><span style="color: #339933;">,</span><a href="http://www.php.net/syslog"><span style="color: #990000;">syslog</span></a><span style="color: #339933;">,</span><a href="http://www.php.net/readlink"><span style="color: #990000;">readlink</span></a><span style="color: #339933;">,</span><a href="http://www.php.net/symlink"><span style="color: #990000;">symlink</span></a><span style="color: #339933;">,</span><a href="http://www.php.net/link"><span style="color: #990000;">link</span></a><span style="color: #339933;">,</span>leak<span style="color: #339933;">,</span><a href="http://www.php.net/fsockopen"><span style="color: #990000;">fsockopen</span></a><span style="color: #339933;">,</span><a href="http://www.php.net/popen"><span style="color: #990000;">popen</span></a><span style="color: #339933;">,</span>escapeshell
&nbsp;
cmd<span style="color: #339933;">,</span><a href="http://www.php.net/error_log"><span style="color: #990000;">error_log</span></a></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.baalchina.net/2008/08/centos%e4%b8%8b%e7%9a%84php%e5%ae%89%e5%85%a8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

