--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/components/php-5_3/php-sapi/patches/041_php_ext_standard_dl.c.patch Thu May 31 14:36:45 2012 -0700
@@ -0,0 +1,37 @@
+--- php-5.3.10/ext/standard/dl.c_orig Sun Jan 1 05:15:04 2012
++++ php-5.3.10/ext/standard/dl.c Wed Feb 8 11:25:26 2012
+@@ -132,12 +132,30 @@
+ }
+ libpath = estrdup(filename);
+ } else if (extension_dir && extension_dir[0]) {
+- int extension_dir_len = strlen(extension_dir);
++ /* if extension_dir supports multiple paths, then look for the extension in each of them */
++ static const char path_sep[] = { ZEND_PATHS_SEPARATOR, 0 };
++ struct stat filetype;
++ char* extdir = NULL;
++ if ((extdir = strtok_r(extension_dir, path_sep, &extension_dir)) != NULL) {
++ do {
++ int extension_dir_len = strlen(extdir);
++ if (IS_SLASH(extdir[extension_dir_len-1])) {
++ spprintf(&libpath, 0, "%s%s", extdir, filename);
++ } else {
++ spprintf(&libpath, 0, "%s%c%s", extdir, DEFAULT_SLASH, filename);
++ }
+
+- if (IS_SLASH(extension_dir[extension_dir_len-1])) {
+- spprintf(&libpath, 0, "%s%s", extension_dir, filename); /* SAFE */
++ if (stat(libpath, &filetype) == 0) {
++ break;
++ }
++ } while (extension_dir && (extdir = strtok_r(NULL, path_sep, &extension_dir)) != NULL);
+ } else {
+- spprintf(&libpath, 0, "%s%c%s", extension_dir, DEFAULT_SLASH, filename); /* SAFE */
++ int extension_dir_len = strlen(extension_dir);
++ if (IS_SLASH(extension_dir[extension_dir_len-1])) {
++ spprintf(&libpath, 0, "%s%s", extension_dir, filename);
++ } else {
++ spprintf(&libpath, 0, "%s%c%s", extension_dir, DEFAULT_SLASH, filename);
++ }
+ }
+ } else {
+ return FAILURE; /* Not full path given or extension_dir is not set */