<?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>为IT服务 [龙飞的博客] &#187; open_basedir</title>
	<atom:link href="http://226617.cn/archives/tag/open_basedir/feed" rel="self" type="application/rss+xml" />
	<link>http://226617.cn</link>
	<description>什么都略懂一点，生活就多彩一些</description>
	<lastBuildDate>Sun, 08 Jan 2012 15:58:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>完美解决nginx环境下服务器上多站点WebShell访问限制问题</title>
		<link>http://226617.cn/archives/887.htm</link>
		<comments>http://226617.cn/archives/887.htm#comments</comments>
		<pubDate>Wed, 06 Jul 2011 01:26:57 +0000</pubDate>
		<dc:creator>龙飞</dc:creator>
				<category><![CDATA[linux相关]]></category>
		<category><![CDATA[nginx相关]]></category>
		<category><![CDATA[php相关]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[open_basedir]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php-fpm]]></category>

		<guid isPermaLink="false">http://226617.cn/?p=887</guid>
		<description><![CDATA[完美解决nginx环境下服务器上多站点WebShell访问限制问题 http://www.discuz.net/thread-1497466-1-1.html wget http://www.php.net/get/php-5.2.10.tar.gz/from/this/mirror wget http://php-fpm.org/downloads/php-5.2.10-fpm-0.5.13.diff.gz tar zxv... ]]></description>
			<content:encoded><![CDATA[<p>完美解决nginx环境下服务器上多站点WebShell访问限制问题</p>
<p>http://www.discuz.net/thread-1497466-1-1.html</p>
<p><code><br />
wget http://www.php.net/get/php-5.2.10.tar.gz/from/this/mirror<br />
wget http://php-fpm.org/downloads/php-5.2.10-fpm-0.5.13.diff.gz<br />
tar zxvf php-5.2.10.tar.gz<br />
gzip -cd php-5.2.10-fpm-0.5.11.diff.gz | patch -d php-5.2.10 -p1<br />
cd php-5.2.10/<br />
./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-freetype-dir --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-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-ftp --without-pear<br />
</code><br />
<code><br />
vi main/fopen_wrappers.c<br />
</code><br />
<code><br />
/* {{{ php_check_open_basedir<br />
*/<br />
PHPAPI int php_check_open_basedir_ex(const char *path, int warn TSRMLS_DC)<br />
{<br />
/* Only check when open_basedir is available */<br />
if (PG(open_basedir) &#038;&#038; *PG(open_basedir)) {<br />
char *pathbuf;<br />
char *ptr;<br />
char *end; </p>
<p>下面加上：<br />
char *env_document_root = sapi_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT")-1 TSRMLS_CC);<br />
if (php_check_specific_open_basedir(ptr, path TSRMLS_CC) == 0) {<br />
efree(env_document_root);<br />
return 0;<br />
}<br />
</code></p>
<p>然后保存，退出。</p>
<p>php.in的open_basedir配置:<br />
修改：<br />
;open_basedir =<br />
为<br />
open_basedir = &#8220;/tmp/:/var/tmp/&#8221; </p>
<p>重启<br />
/usr/local/php/sbin/php-fpm restart </p>
]]></content:encoded>
			<wfw:commentRss>http://226617.cn/archives/887.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php开启open_basedir后启用eaccelerator时File() on line 0报错解决</title>
		<link>http://226617.cn/archives/847.htm</link>
		<comments>http://226617.cn/archives/847.htm#comments</comments>
		<pubDate>Mon, 14 Jun 2010 05:40:26 +0000</pubDate>
		<dc:creator>龙飞</dc:creator>
				<category><![CDATA[linux相关]]></category>
		<category><![CDATA[php相关]]></category>
		<category><![CDATA[eaccelerator]]></category>
		<category><![CDATA[File()]]></category>
		<category><![CDATA[line 0]]></category>
		<category><![CDATA[open_basedir]]></category>

		<guid isPermaLink="false">http://226617.cn/?p=847</guid>
		<description><![CDATA[open_basedir是php提升安全性的重要功能，eaccelerator是提速php的扩展模块，但是似乎默认环境下他们2一起用只要有require就会造成大量的php错误。 PHP Warning: Unknown: open_basedir restriction in effect. File() is ... ]]></description>
			<content:encoded><![CDATA[<p>open_basedir是php提升安全性的重要功能，eaccelerator是提速php的扩展模块，但是似乎默认环境下他们2一起用只要有require就会造成大量的php错误。</p>
<p><code><br />
PHP Warning:  Unknown: open_basedir restriction in effect. File() is not within the allowed path(s): (/www/:/tmp/) in Unknown on line 0<br />
</code></p>
<p>要解决这个问题的话在编译eaccelerator时 加上一个参数就行 &#8211;without-eaccelerator-use-inode<br />
官方也说将在0.9.6.1的下一个release中默认启用这个参数。</p>
]]></content:encoded>
			<wfw:commentRss>http://226617.cn/archives/847.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

