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

- Thread: https://externals.io/message/24216
- Original archive: https://news-web.php.net/php.internals/24216
- Started by Richard Quadling on 2006-06-26T08:50:49+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #24216 — Richard Quadling — 2006-06-26T08:50:49+00:00

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

Hi.

First up, I use windows.

Secondly, I would like to be able to use PHP5 and PHP6 together at the
same time as ISAPI rather than CGI.

I can currently use PHP4 (CGI) and PHP5 (ISAPI) and I can use
different INI files for each (PHP4 uses php.ini, PHP5 CLI uses
php-cli.ini, PHP5 ISAPI uses php-isapi.ini) and all is well.

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

My idea for extending the filename that PHP looks for to include the
major PHP version (from PHP 6 onwards) has not had any response.

Ideally.

php.ini (for PHP4 as that is all there seems to be).
php-sapi.ini (for PHP5 as this is currently working).
php6-sapi.ini (for PHP6 and onwards as this is not yet released and
would actually benefit a LOT of windows users - well, me only,
probably).

Add to that the fallback through the non versioned -sapi and then to
plain php.ini and everything is covered AND you have the future under
control too.

PHP6-isapi.ini, PHP7-ispai.ini, etc.

I'm on Window and I don't have MS Visual Studio or VC++, so I am not
able to compile the PHP source. I have cygwin (I have mods to the
documention). I'm not sure if I compile via cygwin if my PHP will run
in Windows.

I've included my proposed patch.

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 if the determining of the number of
bytes/characters to add to  the emalloc needs to be 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).

If this goes into the PHP6 snapshot, then you can now run PHP4, PHP5
and PHP6 on the same web server each with its own extensions and
setup. Basically, neither of the versions knows about the other.

Hope this is good.

Regards,

Richard Quadling.

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

---

## #24217 — Richard Quadling — 2006-06-26T10:00:30+00:00

URL: https://externals.io/message/24216#24217 · In reply to: #24216

Missing attachment!

-- 
------------------------------------------------------------------------
Bandvulc Group <http://www.bandvulc.co.uk> 	Zend PHP Certificate
<http://zend.com/zce.php?c=ZEND002498&r=213474731>Richard Quadling
Software Developer
Telephone 	+44 (0) 1752 893559 extension 286
Fax 	+44 (0) 1752 690794
Email 	richard.quadling@bandvulc.co.uk
<mailto:richard.quadling@bandvulc.co.uk

---

## #24219 — Andi Gutmans — 2006-06-27T03:49:06+00:00

URL: https://externals.io/message/24216#24219 · In reply to: #24216

I think this is a good idea. It seems like it'll work long term and it does
solve a problem we have today (and already went half way to solving it). 

> -----Original Message-----
> From: Richard Quadling [mailto:rquadling@googlemail.com] 
> Sent: Monday, June 26, 2006 1:51 AM
> To: internals@lists.php.net
> Subject: [PHP-DEV] Supporting version specific INI files as 
> well as SAPI specific INI files.
> 
> Hi.
> 
> First up, I use windows.
> 
> Secondly, I would like to be able to use PHP5 and PHP6 
> together at the same time as ISAPI rather than CGI.
> 
> I can currently use PHP4 (CGI) and PHP5 (ISAPI) and I can use 
> different INI files for each (PHP4 uses php.ini, PHP5 CLI 
> uses php-cli.ini, PHP5 ISAPI uses php-isapi.ini) and all is well.
> 
> In adding PHP6 to the mix, I have no way to create a separate 
> INI file for PHP6.
> 
> My idea for extending the filename that PHP looks for to 
> include the major PHP version (from PHP 6 onwards) has not 
> had any response.
> 
> Ideally.
> 
> php.ini (for PHP4 as that is all there seems to be).
> php-sapi.ini (for PHP5 as this is currently working).
> php6-sapi.ini (for PHP6 and onwards as this is not yet 
> released and would actually benefit a LOT of windows users - 
> well, me only, probably).
> 
> Add to that the fallback through the non versioned -sapi and 
> then to plain php.ini and everything is covered AND you have 
> the future under control too.
> 
> PHP6-isapi.ini, PHP7-ispai.ini, etc.
> 
> I'm on Window and I don't have MS Visual Studio or VC++, so I 
> am not able to compile the PHP source. I have cygwin (I have 
> mods to the documention). I'm not sure if I compile via 
> cygwin if my PHP will run in Windows.
> 
> I've included my proposed patch.
> 
> 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 if the determining of the 
> number of bytes/characters to add to  the emalloc needs to be 
> 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).
> 
> If this goes into the PHP6 snapshot, then you can now run 
> PHP4, PHP5 and PHP6 on the same web server each with its own 
> extensions and setup. Basically, neither of the versions 
> knows about the other.
> 
> Hope this is good.
> 
> Regards,
> 
> Richard Quadling.
> 
> --
> -----
> Richard Quadling
> Zend Certified Engineer : 
> http://zend.com/zce.php?c=ZEND002498&amp;r=213474731
