PHP 5.3.0 open_basedir bug

If you experience open_basedir restrictions in PHP 5.3.0 while active open_basedir path should allow script execution this is a known PHP bug: Bug #48744 and Bug #48880.

Source of this issue lies in fopen_wrappers.c and is already fixed in svn.

Here is the patch you can safely apply to PHP 5.3.0 sources to fixing this issue:

--- php/php-src/branches/PHP_5_3/main/fopen_wrappers.c	2009/06/18 06:38:30	282359
+++ php/php-src/branches/PHP_5_3/main/fopen_wrappers.c	2009/07/31 21:09:45	286602
@@ -93,7 +93,7 @@
 
 	p = (char **) (base + (size_t) mh_arg1);
 
-	if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN) {
+	if (stage == PHP_INI_STAGE_STARTUP || stage == PHP_INI_STAGE_SHUTDOWN || stage == PHP_INI_STAGE_ACTIVATE || stage == PHP_INI_STAGE_DEACTIVATE) {
 		/* We're in a PHP_INI_SYSTEM context, no restrictions */
 		*p = new_value;
 		return SUCCESS;

One Response

  1. BD post ))))

Leave a Reply