Edit report at https://bugs.php.net/bug.php?id=41444&edit=1
ID: 41444 Updated by: ras...@php.net Reported by: geoff dot garside at openhosting dot co dot uk Summary: Version specific php.ini files -Status: Open +Status: Wont fix Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: any PHP Version: 4.4.7 Block user comment: N Private report: N New Comment: People do this with separate ini directories these days. Previous Comments: ------------------------------------------------------------------------ [2007-05-19 21:39:20] geoff dot garside at openhosting dot co dot uk I have written a patch which provides this. The patch is against version 4.4.7 and I have a similar one for PHP 5.2.2 if required but the code is the same. I can't see anywhere to simply attach files, so I will paste it here. --- main/php_ini.c.orig 2007-05-14 20:51:28.000000000 +0100 +++ main/php_ini.c 2007-05-14 21:06:20.000000000 +0100 @@ -395,6 +395,17 @@ fh.filename = php_ini_opened_path; } } + /* Search php%PHP_MAJOR_VERSION%.ini file in search path */ + if (!fh.handle.fp) { + const char *fmt = "php%d.ini"; + char *ini_fname = emalloc(strlen(fmt) + 3); /* Should be good until PHP v999.0 */ + sprintf(ini_fname, fmt, PHP_MAJOR_VERSION); + fh.handle.fp = php_fopen_with_path(ini_fname, "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC); + efree(ini_fname); + if (fh.handle.fp) { + fh.filename = php_ini_opened_path; + } + } /* Search php.ini file in search path */ if (!fh.handle.fp) { fh.handle.fp = php_fopen_with_path("php.ini", "r", php_ini_search_path, &php_ini_opened_path TSRMLS_CC); ------------------------------------------------------------------------ [2007-05-19 21:29:32] geoff dot garside at openhosting dot co dot uk Description: ------------ Some web hosting companies want to run both PHP 4 and PHP 5 on their servers, In these cases it would be useful for PHP to search for a phpX.ini file where X is the value of the PHP_MAJOR_VERSION. This would make it easier for both server admins as well as clients to create separate configs for different versions of PHP within their websites. I have selected version 4.4.7 as I am required to choose a version, but this should equally pertain to PHP 5.2.2 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=41444&edit=1