php 5.2.15 open_basedir restriction error

时间: 2010-12-15 / 分类: linux 技术, 系统运维 / 浏览次数: 613 views / 0个评论 发表评论

php 5.2.15 bug open_basedir restriction

详细情况可以看官方网  http://bugs.php.net/bug.php?id=53516

把patch 文件上传到

diff -ruN php-5.2.15/main/fopen_wrappers.c php-5.2.15.ofi/main/fopen_wrappers.c
--- php-5.2.15/main/fopen_wrappers.c	2010-12-09 18:04:29.000000000 +0100
+++ php-5.2.15.ofi/main/fopen_wrappers.c	2010-12-10 11:32:02.000000000 +0100
@@ -192,7 +192,7 @@
 		if (strncmp(resolved_basedir, resolved_name, resolved_basedir_len) == 0) {
 #endif
 			if (resolved_name_len > resolved_basedir_len &&
-				resolved_name[resolved_basedir_len] != PHP_DIR_SEPARATOR) {
+				resolved_name[resolved_basedir_len - 1] != PHP_DIR_SEPARATOR) {
 				return -1;
 			} else {
 				/* File is in the right directory */
ssh 服务器, patch -p0 < open_basedir.patch 即可

在编译安装php, php 5.2.15 就可以支持open_basedir 了

发表评论

您的昵称 *

您的邮箱 *

您的网站