# Supporting version specific INI files as well as SAPI specific INI files.

- Thread: https://externals.io/message/24405
- Original archive: https://news-web.php.net/php.internals/24405
- Started by Richard Quadling on 2006-07-15T20:10:35+00:00
- Messages: 15
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #24405 — Richard Quadling — 2006-07-15T20:10:35+00:00

URL: https://externals.io/message/24405#24405

Hi.

First up, I use windows. I do NOT use Apache. I also do not use IIS. I
use Sambar Server as this fits my needs very well and is extremely
easy to work with and I can get a client's intranet running in a few
minutes. I'm not saying it is BETTER, just fits my requirements.

Secondly, I would like to be able to use PHP4, PHP5 and PHP6 together
at the same time. Preferably ISAPI rather than CGI (mainly persistent
DB connections).

I can currently use PHP4 (CGI) and PHP5 (ISAPI) and I can use
different INI files for each (PHP4 uses php-cgi.ini, PHP5 CLI uses
php-cli.ini, PHP5 ISAPI uses php-isapi.ini) and all is well. The PHP
userland files have .php4 for PHP4 and .php5 for PHP5. (Though .php
will also be treated as PHP5).

In adding PHP6 to the mix, I have no way to create a separate INI file for PHP6.

I am not able to recompile PHP (though I am looking at the MS VC++
Express Edition as this is free - any comments?).

There is no mechanism of providing a specific INI file for a
particular ISAPI or CGI extension within Sambar, so the extension (in
this case PHP4 cgi and PHP5 isapi) will follow whatever is defined
within itself to find the appropriate config file.

Currently PHP can use many techniques to define the external config
file name. PHP can also use many techniques to locate the file.

Currently, then PHP looks for an external filename it will look for a
SAPI specific version (php-cli.ini, php-isapi.ini, php-cgi.ini).

If this is not found, then PHP will look for plain old, php.ini

My proposal (and the attached patch) extends this to allow PHP to look
for a version specific SAPI ini file.

phpx-sapi.ini, where x is the version number.

I've allowed upto V99.

The patch will fallback to looking for the non-versioned sapi specific
ini file and then onto plain old php.ini, just as before.

I copied the code dealing with php-%sapi-module-name% and extended it
to deal with PHP_MAJOR_VERSION.

The only thing I'm not sure of is in determining the number of
bytes/characters to add if emalloc's needs are different for other
platforms. If the `PHP_MAJOR_VERSION` is less than 10 then I need to add
1 byte/character otherwise add 2 (to allow up to `PHP_MAJOR_VERSION` of
99).

I've just downloaded via CVS the latest php-src and the patch is
against /* $Id: php_ini.c,v 1.143 2006/07/04 06:38:32 dmitry Exp $ */

Regards,

Richard Quadling.

-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&amp;r=213474731

---

## #24411 — Stanislav Malyshev — 2006-07-16T08:07:38+00:00

URL: https://externals.io/message/24405#24411 · In reply to: #24405

RQ>>Secondly, I would like to be able to use PHP4, PHP5 and PHP6 together 
RQ>>at the same time. Preferably ISAPI rather than CGI (mainly persistent 
RQ>>DB connections).

You may want to look into some FastCGI solution. They should have little 
problem running several PHP versions, and performance would be comparable 
to that of ISAPI/apache module.

RQ>>My proposal (and the attached patch) extends this to allow PHP to look
RQ>>for a version specific SAPI ini file.

This is a good idea, I think. We might add version-dependent registry 
entries for Windows too.

-- 
Stanislav Malyshev, Zend Products Engineer
stas@zend.com  http://www.zend.com/ +972-3-6139665 ext.115

---

## #24425 — Richard Quadling — 2006-07-17T10:16:42+00:00

URL: https://externals.io/message/24405#24425

Having used regmon, in conjunction with the source (still learning my
way around the source), PHP accesses the following registry keys :

HKLM\SOFTWARE\PHP\IniFilePath
HKLM\SOFTWARE\PHP\Per Directory Values


What naming convention would you expect to be used for version
specific settings. I would think a new subkey ...

(Original)
HKLM\SOFTWARE\PHP\IniFilePath
HKLM\SOFTWARE\PHP\Per Directory Values

(Additional)
HKLM\SOFTWARE\PHP\V4\IniFilePath
HKLM\SOFTWARE\PHP\V4\Per Directory Values

HKLM\SOFTWARE\PHP\V5\IniFilePath
HKLM\SOFTWARE\PHP\V5\Per Directory Values

HKLM\SOFTWARE\PHP\V6\IniFilePath
HKLM\SOFTWARE\PHP\V6\Per Directory Values

etc.

The version specific IniFilePath will be added to the search path
BEFORE the default IniFilePath.

The version specific PerDirectoryValues (if present) would override
the default values (if present).



This is a pretty advanced set of rules for configuring ini settings!

You can set them globally (either in a INI file or the registry),
based upon the major version of PHP (INI file or registry), where the
PHP file is (registry) and for the specific PHP file (registry), as
well as things like Apache .htaccess or even within the PHP code
itself.


If this is all OK, I'll talk to Nuno about incorporating the changes
to the documentation.

And then, I may leave you all alone! (Well, WIBNI!).





> From my initial look, it seems that the registry only contains the a
> path to the ini file, not the actual ini file itself.
>
> If that is the case, then the patch still stands.
>
> Unless, specific settings can be made to the registry... which makes more sense.
>
> So. More looking.
>
> 
> > […]
> -----
> Richard Quadling
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&amp;r=213474731
>


-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&amp;r=213474731

---

## #24426 — Edin Kadribasic — 2006-07-17T11:27:34+00:00

URL: https://externals.io/message/24405#24426 · In reply to: #24425

Hi Richard,

I think your ini changes should be put into PHP. I have a small feature
request. Since we're modifying the way ini files are picked up we might
as well add support for minor version numbers since PHP is not binary
compatible between minor version releases. That would allow people to
run 5.0 5.1 and 5.2 in the same system.

Edin


Richard Quadling wrote:
> Having used regmon, in conjunction with the source (still learning my
> way around the source), PHP accesses the following registry keys :
>
> HKLM\SOFTWARE\PHP\IniFilePath
> HKLM\SOFTWARE\PHP\Per Directory Values
>
>
> What naming convention would you expect to be used for version
> specific settings. I would think a new subkey ...
>
> (Original)
> HKLM\SOFTWARE\PHP\IniFilePath
> HKLM\SOFTWARE\PHP\Per Directory Values
>
> (Additional)
> HKLM\SOFTWARE\PHP\V4\IniFilePath
> HKLM\SOFTWARE\PHP\V4\Per Directory Values
>
> HKLM\SOFTWARE\PHP\V5\IniFilePath
> HKLM\SOFTWARE\PHP\V5\Per Directory Values
>
> HKLM\SOFTWARE\PHP\V6\IniFilePath
> HKLM\SOFTWARE\PHP\V6\Per Directory Values
>
> etc.
>
> The version specific IniFilePath will be added to the search path
> BEFORE the default IniFilePath.
>
> The version specific PerDirectoryValues (if present) would override
> the default values (if present).
>
>
>
> This is a pretty advanced set of rules for configuring ini settings!
>
> You can set them globally (either in a INI file or the registry),
> based upon the major version of PHP (INI file or registry), where the
> PHP file is (registry) and for the specific PHP file (registry), as
> well as things like Apache .htaccess or even within the PHP code
> itself.
>
>
> If this is all OK, I'll talk to Nuno about incorporating the changes
> to the documentation.
>
> And then, I may leave you all alone! (Well, WIBNI!).
>
>
>
>
> 
> > […]
>
>
> ------------------------------------------------------------------------
>
> Index: main/php_ini.c
> ===================================================================
> RCS file: /repository/php-src/main/php_ini.c,v
> retrieving revision 1.143
> diff -u -r1.143 php_ini.c
> --- main/php_ini.c	4 Jul 2006 06:38:32 -0000	1.143
> +++ main/php_ini.c	17 Jul 2006 10:05:50 -0000
> @@ -318,7 +318,17 @@
>  
>  #ifdef PHP_WIN32
>  		/* Add registry location */
> -		reg_location = GetIniPathFromRegistry();
> +		/* RAQ : Add version specific registry location */
> +		reg_location = GetIniPathFromRegistry(1);
> +		if (reg_location != NULL) {
> +			if (*php_ini_search_path) {
> +				strcat(php_ini_search_path, paths_separator);
> +			}
> +			strcat(php_ini_search_path, reg_location);
> +			efree(reg_location);
> +		}
> +		/* RAQ : Get non-version specific registry location : reg_location = GetIniPathFromRegistry(); */
> +		reg_location = GetIniPathFromRegistry(0);
>  		if (reg_location != NULL) {
>  			if (*php_ini_search_path) {
>  				strcat(php_ini_search_path, paths_separator);
> @@ -428,6 +438,17 @@
>  				}
>  			}
>  		}
> +		/* RAQ : Search php%php-major-version%-%sapi-module-name%.ini file in search path */
> +		if (!fh.handle.fp) {
> +			const char *fmt = "php%d-%s.ini";
> +			char *ini_fname = emalloc(strlen(fmt) + strlen(sapi_module.name) + (PHP_MAJOR_VERSION < 10 ? 1 : 2));
> +			sprintf(ini_fname, fmt, PHP_MAJOR_VERSION, sapi_module.name);
> +			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-%sapi-module-name%.ini file in search path */
>  		if (!fh.handle.fp) {
>  			const char *fmt = "php-%s.ini";
> Index: win32/php_registry.h
> ===================================================================
> RCS file: /repository/php-src/win32/php_registry.h,v
> retrieving revision 1.4
> diff -u -r1.4 php_registry.h
> --- win32/php_registry.h	19 Oct 2003 10:22:21 -0000	1.4
> +++ win32/php_registry.h	17 Jul 2006 10:05:51 -0000
> @@ -3,6 +3,7 @@
>  
>  
>  void UpdateIniFromRegistry(char *path TSRMLS_DC);
> -char *GetIniPathFromRegistry();
> +/* RAQ : Allow for version specificness */
> +char *GetIniPathFromRegistry(int version_specific);
>  
>  #endif /* PHP_REGISTRY_H */
> Index: win32/registry.c
> ===================================================================
> RCS file: /repository/php-src/win32/registry.c,v
> retrieving revision 1.16
> diff -u -r1.16 registry.c
> --- win32/registry.c	14 Mar 2005 12:42:05 -0000	1.16
> +++ win32/registry.c	17 Jul 2006 10:05:51 -0000
> @@ -9,7 +9,26 @@
>  	HKEY MainKey;
>  	char *strtok_buf = NULL;
>  
> -	if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, PHP_REGISTRY_KEY "\\Per Directory Values", 0, KEY_READ, &MainKey)!=ERROR_SUCCESS) {
> +	/* RAQ : Version specificness */
> +	int version_specific;
> +	char * reg_key;
> +
> +	/* RAQ : Get default and then version specific entries. */
> +	for (version_specific = 0 ; version_specific < 2 ; ++version_specific) {
> +
> +		/* RAQ : Build key which may include version specificness */
> +		DWORD keylen = strlen(PHP_REGISTRY_KEY);
> +		if (1 == version_specific) {
> +			reg_key = (char *) emalloc(strlen(PHP_REGISTRY_KEY) + strlen("\\V\\Per Directory Values") + (PHP_MAJOR_VERSION < 10 ? 1 : 2));
> +			sprintf(reg_key, "%c\\V%d\\Per Directory Values", PHP_REGISTRY_KEY, PHP_MAJOR_VERSION);
> +		} else {
> +			reg_key = (char *) emalloc(strlen(PHP_REGISTRY_KEY) + strlen("\\Per Directory Values"));
> +			sprintf(reg_key, "%c\\Per Directory Values", PHP_REGISTRY_KEY);
> +		}
> +		/* RAQ END : Continue with appropriate key. */
> +
> +	/* RAQ : Use potentially version specific registry key : if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, PHP_REGISTRY_KEY "\\Per Directory Values", 0, KEY_READ, &MainKey)!=ERROR_SUCCESS) { */
> +	if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, reg_key, 0, KEY_READ, &MainKey)!=ERROR_SUCCESS) {
>  		return;
>  	}
>  
> @@ -55,7 +74,7 @@
>  		HKEY hKey;
>  		DWORD lType;
>  		DWORD values = 0, max_name = 0, max_value = 0, i = 0;
> -		
> +
>  		if (p>path) {
>  			*(p-1) = '\\'; /* restore the slash */
>  		}
> @@ -91,16 +110,29 @@
>  	}
>  	RegCloseKey(MainKey);
>  	efree(orig_path);
> +	} /* RAQ : End of version specificness loop */
>  }
>  
>  #define PHPRC_REGISTRY_NAME "IniFilePath"
>  
> -char *GetIniPathFromRegistry()
> +char *GetIniPathFromRegistry(int version_specific)
>  {
>  	char *reg_location = NULL;
>  	HKEY hKey;
> -	
> -	if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, PHP_REGISTRY_KEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
> +	char *reg_key = NULL;
> +
> +	/* RAQ : Build key which may include version specificness */
> +	DWORD keylen = strlen(PHP_REGISTRY_KEY);
> +	if (1 == version_specific) {
> +		reg_key = (char *) emalloc(strlen(PHP_REGISTRY_KEY) + strlen("\\V") + (PHP_MAJOR_VERSION < 10 ? 1 : 2));
> +		sprintf(reg_key, "%c\\V%d", PHP_REGISTRY_KEY, PHP_MAJOR_VERSION);
> +	} else {
> +		reg_key = (char *) emalloc(strlen(PHP_REGISTRY_KEY));
> +		sprintf(reg_key, "%c", PHP_REGISTRY_KEY);
> +	}
> +
> +	/* RAQ : Use potentially version specific registry key : if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, PHP_REGISTRY_KEY, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {*/
> +	if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, reg_key, 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
>  		DWORD buflen = MAXPATHLEN;
>  		reg_location = emalloc(MAXPATHLEN+1);
>  		if(RegQueryValueEx(hKey, PHPRC_REGISTRY_NAME, 0, NULL, reg_location, &buflen) != ERROR_SUCCESS) {

---

## #24427 — Ron Korving — 2006-07-17T11:52:51+00:00

URL: https://externals.io/message/24405#24427 · In reply to: #24426

What kind of extensions would you suggest people use?

index.php51 ?

- Ron


"Edin Kadribasic" <edink@emini.dk> schreef in bericht 
news:44BB7426.9060501@emini.dk...
> Hi Richard,
>
> I think your ini changes should be put into PHP. I have a small feature
> request. Since we're modifying the way ini files are picked up we might
> as well add support for minor version numbers since PHP is not binary
> compatible between minor version releases. That would allow people to
> run 5.0 5.1 and 5.2 in the same system.
>
> Edin
>
>
> Richard Quadling wrote:
> > […]

---

## #24430 — Richard Quadling — 2006-07-17T13:23:23+00:00

URL: https://externals.io/message/24405#24430 · In reply to: #24427

I suppose this would have to be the case.

I did think about major, major_minor, major_minor_release and
major_minor_release_extra (for _dev).

But then that is a HUGE number of options. But, you DON'T have to use
them. The fallback is EXACTLY as it is at the moment.

If that is OK, then I'll add the whole hog (but maybe NOT the release_extra).



> What kind of extensions would you suggest people use?
>
> index.php51 ?
>
> - Ron
>
>
> "Edin Kadribasic" <edink@emini.dk> schreef in bericht
> news:44BB7426.9060501@emini.dk...
> > […]

-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&amp;r=213474731

---

## #24434 — Matthew C. Kavanagh — 2006-07-17T19:58:40+00:00

URL: https://externals.io/message/24405#24434 · In reply to: #24427

Assuming it's possible, I would set which PHP version to associate with
.php on a .htaccess or vhost basis.


> What kind of extensions would you suggest people use?
> 
> index.php51 ?
> 
> - Ron

---

## #24435 — Ron Korving — 2006-07-17T20:25:12+00:00

URL: https://externals.io/message/24405#24435 · In reply to: #24434

That would be the wet dream of any web hoster (including myself).

- Ron


""Matthew C. Kavanagh"" <matthew@teh.ath.cx> wrote in message
news:1153166320.18418.10.camel@localhost.localdomain...
> Assuming it's possible, I would set which PHP version to associate with
> .php on a .htaccess or vhost basis.
>
> 
> > […]

---

## #24436 — Robert Cummings — 2006-07-17T20:45:32+00:00

URL: https://externals.io/message/24405#24436 · In reply to: #24434

> 
> > […]


> Assuming it's possible, I would set which PHP version to associate with
> .php on a .htaccess or vhost basis.

While the php.ini system is under consideration... and with an eye to
the far future... what about an import directive to include another ini
file?

php6.ini:
-----------------------------------------

@import = /etc/php.shared.ini

;
; Then have PHP6 specific directives.
;

-----------------------------------------

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

---

## #24437 — Brian Moon — 2006-07-17T20:59:50+00:00

URL: https://externals.io/message/24405#24437 · In reply to: #24436

> While the php.ini system is under consideration... and with an eye to
> the far future... what about an import directive to include another ini
> file?

Not that it is exactly the same, but you have this in configure:

   --with-config-file-scan-dir=PATH
   Set the path where to scan for configuration files

It is very useful for loading optional modules and such.  I had never 
used it until I started using an emerged PHP build on Gentoo.  Its quite 
nice.

-- 

Brian Moon
-------------
http://dealnews.com/
Its good to be cheap =)

---

## #24454 — Richard Quadling — 2006-07-18T08:17:42+00:00

URL: https://externals.io/message/24405#24454 · In reply to: #24437

My main focus is on the Windows environment. I'm not in a position to
make any judgements about non windows platforms. As such, my patches
are to extend the capabilities of the windows precompiled binaries.

Most webservers should be able to map different extensions to
different handlers.

As I've said previously within this thread, I use Sambar Server with
PHP4 and PHP5 concurrently - .php4 files are handled via
c:\php4\php.exe (as a CGI) and .php/.php5 are handled via
c:\php5\php5isapi.dll (as an ISAPI module). In neither case can I
supply a config and I need PHP to determine its own appopriate file -
hence the patches.




> > […]
>
> Not that it is exactly the same, but you have this in configure:
>
>    --with-config-file-scan-dir=PATH
>    Set the path where to scan for configuration files
>
> It is very useful for loading optional modules and such.  I had never
> used it until I started using an emerged PHP build on Gentoo.  Its quite
> nice.
>
> --
>
> Brian Moon
> -------------
> http://dealnews.com/
> Its good to be cheap =)
>
> --
> 
> 
>
>


-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&amp;r=213474731

---

## #24455 — Richard Quadling — 2006-07-18T08:39:34+00:00

URL: https://externals.io/message/24405#24455 · In reply to: #24454

The supplied patch enhances PHP's .INI from ...

php-%sapi-name%.ini

to ...

php%php-version%-%sapi-module-name%.ini
php%php-major-version%.%php-minor-version%.%php-release-version%-%sapi-module-name%.ini
php%php-major-version%.%php-minor-version%-%sapi-module-name%.ini
php%php-major-version%-%sapi-module-name%.ini

with the original as a fallback.

e.g.

from

php-isapi.ini

to

php5.2.0-dev-isapi.ini
php5.1.4-isapi.ini
php5.0-isapi.ini
php5-isapi.ini
php-isapi.ini

(Just examples - all combinations are valid).


With the INI files, the most specific one is looked for first and each
check gets less specific until a file is found.



The supplied patches also do the same work with the Windows Registry.

Currently the registry key examined is ...

SOFTWARE\\PHP

This is extended to ...

SOFTWARE\\PHP\\V5\\Per Directory Values
SOFTWARE\\PHP\\V5.1\\Per Directory Values
SOFTWARE\\PHP\\V5.1.4\\Per Directory Values
SOFTWARE\\PHP\\V5.2.0-dev\\Per Directory Values

The more specific settings will override the less specific settings.

And the supplied patches allow for the location of the ini file on a
per PHP version basis...

SOFTWARE\\PHP\\V5\\IniFilePath
SOFTWARE\\PHP\\V5.1\\IniFilePath
SOFTWARE\\PHP\\V5.1.4\\IniFilePath
SOFTWARE\\PHP\\V5.2.0-dev\\IniFilePath

The more specific paths will be examined before the less specific paths.


NOTE: I am NOT able to verify this code as I am not yet able to
compile PHP. I'm still learning this, so please accept my apologies
for any syntax errors, bugs. I'm more than willing to fix them! And if
anyone has used MS VC++ Express Edition to build PHP, I'd be REALLY
grateful to have any notes/comments about the process.

Thanks,

Richard Quadling.


-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&amp;r=213474731

---

## #24457 — Matt W — 2006-07-18T09:48:02+00:00

URL: https://externals.io/message/24405#24457 · In reply to: #24455

Hi Richard,

----- Original Message ----- 
From: "Richard Quadling"

> NOTE: I am NOT able to verify this code as I am not yet able to
> compile PHP. I'm still learning this, so please accept my apologies
> for any syntax errors, bugs. I'm more than willing to fix them! And if
> anyone has used MS VC++ Express Edition to build PHP, I'd be REALLY
> grateful to have any notes/comments about the process.

I just found out about VC++ Express about a month ago in the while browsing
through Sara Goleman's new book with Amazon's Viewer -- was able to see the
Windows compile instructions. :-)  I discovered there are a few things
missing from those instructions, however, after many errors which I was able
to fix or work around, luckily.

Do you know anything about what to do?  Or you'd just be starting from
scratch like I was?  I'd be glad to try and answer any questions you have -- 
from what to download first all the way through to your own binary. :-)
BTW, I've only compiled the bare CLI version so far; so only built-in
extensions, no server APIs, etc.

Because my VC++ Express install is missing this one file (I've yet to look
into why), I have to make small changes in a couple of PHP's files (simple
now that I got used to it :-)) for it to compile.  With PHP 6, you also have
to download ICU Unicode headers/libraries.  AND, I've only downloaded one
CVS snapshot of 6's source so far, but it has a fatal error when trying to
compile -- I got around that by modifying a couple of the VC++ header
files(?!?!), which results in tons and tons of warnings, but the build seems
to work fine -- though I'm only really using the functions whose source I'm
playing with. :-)

I was going to put something online about my Windows compiling experiences,
but haven't gotten to it yet.  Anyway, feel free to ask, and I'll try to
answer ASAP!

> Thanks,
>
> Richard Quadling.

Hope that helps,
Matt

---

## #25065 — Richard Quadling — 2006-07-30T13:52:48+00:00

URL: https://externals.io/message/24405#25065 · In reply to: #24455

Do I have to do anything else to get this patch submitted?

Is there anything more required within it?

Where do I go from here?

Do I need a sponsor?

Do I have to get a CVS account with adequate karma to commit the patch myself?

Anyone? Is there anyone out there?

Patch can be retrieved from http://rquadling.php1h.com/ini_patch.diff.txt

Regards,

Richard Quadlng.


> The supplied patch enhances PHP's .INI from ...
>
> php-%sapi-name%.ini
>
> to ...
>
> php%php-version%-%sapi-module-name%.ini
> php%php-major-version%.%php-minor-version%.%php-release-version%-%sapi-module-name%.ini
> php%php-major-version%.%php-minor-version%-%sapi-module-name%.ini
> php%php-major-version%-%sapi-module-name%.ini
>
> with the original as a fallback.
>
> e.g.
>
> from
>
> php-isapi.ini
>
> to
>
> php5.2.0-dev-isapi.ini
> php5.1.4-isapi.ini
> php5.0-isapi.ini
> php5-isapi.ini
> php-isapi.ini
>
> (Just examples - all combinations are valid).
>
>
> With the INI files, the most specific one is looked for first and each
> check gets less specific until a file is found.
>
>
>
> The supplied patches also do the same work with the Windows Registry.
>
> Currently the registry key examined is ...
>
> SOFTWARE\\PHP
>
> This is extended to ...
>
> SOFTWARE\\PHP\\V5\\Per Directory Values
> SOFTWARE\\PHP\\V5.1\\Per Directory Values
> SOFTWARE\\PHP\\V5.1.4\\Per Directory Values
> SOFTWARE\\PHP\\V5.2.0-dev\\Per Directory Values
>
> The more specific settings will override the less specific settings.
>
> And the supplied patches allow for the location of the ini file on a
> per PHP version basis...
>
> SOFTWARE\\PHP\\V5\\IniFilePath
> SOFTWARE\\PHP\\V5.1\\IniFilePath
> SOFTWARE\\PHP\\V5.1.4\\IniFilePath
> SOFTWARE\\PHP\\V5.2.0-dev\\IniFilePath
>
> The more specific paths will be examined before the less specific paths.
>
>
> NOTE: I am NOT able to verify this code as I am not yet able to
> compile PHP. I'm still learning this, so please accept my apologies
> for any syntax errors, bugs. I'm more than willing to fix them! And if
> anyone has used MS VC++ Express Edition to build PHP, I'd be REALLY
> grateful to have any notes/comments about the process.
>
> Thanks,
>
> Richard Quadling.
>
>
> --
> -----
> Richard Quadling
> Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&amp;r=213474731
>
>
>


-- 
-----
Richard Quadling
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&amp;r=213474731
"Standing on the shoulders of some very clever giants!"

---

## #25151 — Richard Lynch — 2006-08-02T21:14:30+00:00

URL: https://externals.io/message/24405#25151 · In reply to: #24435

[top-posting since everybody else did...]

Call me silly, but, really, why is it so tricky in Apache/PHP that you
can't somehow convince that LoadModule/AddModule thingie to use
'php51' or 'whatever-i-want' for different versions, so that then you
can just use different mime types for all the versions you want?

It's just an identifier string, really, isn't it?...

Could it be something one could specify at compile-time and then it
would carry through?

cd ../php5.1/
./configure --apache-mime-type php51 ...
cd ../php5.2/
./configure --apache-mime-type php52 ...

LoadModule php51.so
LoadModule php52.so
.
.
.

I seem to recall that there was some kind of problem with the naming
of C functions within the .so files conflicting with versions?  So I
guess maybe that's the real problem?  But surely there are conflicts
between all the Apache modules and there is already a
conflict-resolution process, no?...

Am I just being dense?


> That would be the wet dream of any web hoster (including myself).
>
> - Ron
>
>
> ""Matthew C. Kavanagh"" <matthew@teh.ath.cx> wrote in message
> news:1153166320.18418.10.camel@localhost.localdomain...
> > […]
>
> --
> 
> 
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm
