--- sapi/cli/php_cli.c.orig	Wed Jan  5 10:02:06 2011
+++ sapi/cli/php_cli.c	Wed Jan  5 10:02:06 2011
@@ -662,6 +662,7 @@ int main(int argc, char *argv[])
 	char *exec_direct=NULL, *exec_run=NULL, *exec_begin=NULL, *exec_end=NULL;
 	const char *param_error=NULL;
 	int hide_argv = 0;
+	char *ini;
 /* end of temporary locals */
 #ifdef ZTS
 	void ***tsrm_ls;
@@ -707,7 +708,11 @@ int main(int argc, char *argv[])
 #endif
 
 	cli_sapi_module.ini_defaults = sapi_cli_ini_defaults;
-	cli_sapi_module.php_ini_path_override = NULL;
+	if ((ini = getenv("PHP_INI_PATH"))) {
+		cli_sapi_module.php_ini_path_override = strdup(ini);
+	} else {
+		cli_sapi_module.php_ini_path_override = NULL;
+	}
 	cli_sapi_module.phpinfo_as_text = 1;
 	sapi_startup(&cli_sapi_module);
 
