VPS侦探论坛

 找回密码
 注册
查看: 6608|回复: 2

安装php5.2.17补丁时的错误信息,请军哥看看

[复制链接]
发表于 2012-1-5 13:03:02 | 显示全部楼层 |阅读模式

出现了几个FAILED,不知道错在哪里,请军哥看看问题在哪?

我已经确定php-5.2.17-max-input-vars.patch是Unix回车符。

[root@localhost php-5.2.17]# patch -p1 < php-5.2.17-max-input-vars.patch
patching file configure
patching file configure.in
patching file main/main.c
Hunk #1 FAILED at 457.
1 out of 1 hunk FAILED -- saving rejects to file main/main.c.rej
patching file main/php_globals.h
Hunk #1 FAILED at 160.
1 out of 1 hunk FAILED -- saving rejects to file main/php_globals.h.rej
patching file main/php_variables.c
Hunk #1 FAILED at 187.
Hunk #2 FAILED at 235.
2 out of 2 hunks FAILED -- saving rejects to file main/php_variables.c.rej
patching file main/php_version.h
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
 楼主| 发表于 2012-1-5 13:18:18 | 显示全部楼层

php-5.2.17-max-input-vars.patch



diff -u -r php-5.2.17/configure php-5.2.17-patched/configure
--- php-5.2.17/configure 2011-01-07 07:04:43.000000000 +0800
+++ php-5.2.17-patched/configure 2011-12-31 11:46:11.000000000 +0800
@@ -2165,7 +2165,7 @@
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=2
PHP_RELEASE_VERSION=17
-PHP_EXTRA_VERSION=""
+PHP_EXTRA_VERSION="p1"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr $PHP_MAJOR_VERSION \* 10000 + $PHP_MINOR_VERSION \* 100 + $PHP_RELEASE_VERSION`

diff -u -r php-5.2.17/configure.in php-5.2.17-patched/configure.in
--- php-5.2.17/configure.in 2011-01-07 07:01:19.000000000 +0800
+++ php-5.2.17-patched/configure.in 2011-12-31 09:59:05.000000000 +0800
@@ -42,7 +42,7 @@
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=2
PHP_RELEASE_VERSION=17
-PHP_EXTRA_VERSION=""
+PHP_EXTRA_VERSION="p1"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`

diff -u -r php-5.2.17/main/main.c php-5.2.17-patched/main/main.c
--- php-5.2.17/main/main.c 2010-06-20 04:47:24.000000000 +0800
+++ php-5.2.17-patched/main/main.c 2011-12-31 09:59:05.000000000 +0800
@@ -457,6 +457,7 @@

  STD_PHP_INI_BOOLEAN("allow_url_fopen", "1", PHP_INI_SYSTEM, OnUpdateBool, allow_url_fopen, php_core_globals, core_globals)
  STD_PHP_INI_BOOLEAN("allow_url_include", "0", PHP_INI_SYSTEM, OnUpdateBool, allow_url_include, php_core_globals, core_globals)
+ STD_PHP_INI_ENTRY("max_input_vars", "1000", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateLongGEZero, max_input_vars, php_core_globals, core_globals)
  STD_PHP_INI_BOOLEAN("always_populate_raw_post_data", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateBool, always_populate_raw_post_data, php_core_globals, core_globals)

  STD_PHP_INI_ENTRY("realpath_cache_size", "16K", PHP_INI_SYSTEM, OnUpdateLong, realpath_cache_size_limit, virtual_cwd_globals, cwd_globals)
diff -u -r php-5.2.17/main/php_globals.h php-5.2.17-patched/main/php_globals.h
--- php-5.2.17/main/php_globals.h 2010-01-03 17:23:27.000000000 +0800
+++ php-5.2.17-patched/main/php_globals.h 2011-12-31 09:59:05.000000000 +0800
@@ -160,6 +160,7 @@
  zend_bool com_initialized;
#endif
  long max_input_nesting_level;
+ long max_input_vars;
  zend_bool in_user_include;
  zend_bool in_error_log;
};
diff -u -r php-5.2.17/main/php_variables.c php-5.2.17-patched/main/php_variables.c
--- php-5.2.17/main/php_variables.c 2010-01-03 17:23:27.000000000 +0800
+++ php-5.2.17-patched/main/php_variables.c 2011-12-31 09:59:05.000000000 +0800
@@ -187,6 +187,9 @@
  }
  if (zend_symtable_find(symtable1, escaped_index, index_len + 1, (void **) &gpc_element_p) == FAILURE
  || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) {
+ if (zend_hash_num_elements(symtable1) >= PG(max_input_vars)) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
+ }
  MAKE_STD_ZVAL(gpc_element);
  array_init(gpc_element);
  zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
@@ -232,6 +235,9 @@
  zend_symtable_exists(symtable1, escaped_index, index_len + 1)) {
  zval_ptr_dtor(&gpc_element);
  } else {
+ if (zend_hash_num_elements(symtable1) >= PG(max_input_vars)) {
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
+ }
  zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
  }
  if (escaped_index != index) {
diff -u -r php-5.2.17/main/php_version.h php-5.2.17-patched/main/php_version.h
--- php-5.2.17/main/php_version.h 2011-01-07 07:01:19.000000000 +0800
+++ php-5.2.17-patched/main/php_version.h 2011-12-31 11:46:13.000000000 +0800
@@ -3,6 +3,6 @@
#define PHP_MAJOR_VERSION 5
#define PHP_MINOR_VERSION 2
#define PHP_RELEASE_VERSION 17
-#define PHP_EXTRA_VERSION ""
-#define PHP_VERSION "5.2.17"
+#define PHP_EXTRA_VERSION "p1"
+#define PHP_VERSION "5.2.17p1"
#define PHP_VERSION_ID 50217
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
发表于 2012-1-5 17:45:27 | 显示全部楼层

不清楚
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-22 01:20 , Processed in 0.025844 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表