My environment:
Windows Enterprise Server 2003
IIS6.0
PHP3.8.9
PHP5.0.1
MYSQL4.0.20d
MS SQL2000
I would like to create a nice integration development environment in the same machine that supports IIS -> PHP -> (Mysql or MSSQL) in the same server
I've had a very hard time getting PHP4 and PHP5 running concurrently. The closest that I was able to get it was to
Unpack all php 4 into c:\httpd\php4
copy all files from c:\httpd\php4\sapi\* and dll\* into c:httpd\php4 directory (i.e. move up one directory)
Unpack all php 5 into c:\httpd\php5
Set the administration PATH env variable to PATH=...;c:\httpd\php5\;c:\httpd\php4
Go to IIS -> Web Service Extensions - > Add New Extension (1) for PHP pointing to c:\httpd\php4\php4isapi.dll and (2) for PHP5 pointing to c:\httpd\php5\php5isapi.dll
Go to IIS -> Web Sites -> [Properties] -> Home Directory -> Configuration... -> add mappings .php5 to php5isapi.dll and .php to php5isapi.dll
edit php.ini-recommended on each directory (i.e. php4 and php5) only uncommented several dynamic extensions and, cgi.force_redirect = 0, and extension_dir = "c:\httpd\[php4 | php5]\ext\"
Cold boot
While I can get both php to respond correctly, I cannot see any dynamic extensions loaded.
Qustions:
Under the above arrangement which php.ini is being use for php5? At one point I deleted php.ini and it made no difference.
I have opted to set PHPRC = c:\httpd\php5 which does ready the php.ini and loads my extension correctly. However I break php4. What to do?
Thanks,
Orlando
Also, php.ini needs to reside in the %windir% directory (C:\WINDOWS, C:\WINNT, or wherever).
I'm not an IIS user (I use Sambar Server http://www.sambar.com). I also only use PHP5.0.1 now.
An assumption.
I would assume that if you were to develop a site, you would use PHP4 OR PHP5. Not both.
If so, the site itself would be the determining factor on whether to use PHP4 or PHP5?
If so, does IIS support a method where you can set the php.ini path in a something like a .htaccess file? I may have all the terminology mixed up here (I don't use .htaccess either!).
I've seen .htaccess used to control PHP's behaviour.
Also, I've just looked through the PHP manual ...
Changing PHP configuration via the Windows registry
When running PHP on Windows, the configuration values can be modified on per-directory basis using the Windows registry. The configuration values are stored in the registry key HKLM\SOFTWARE\PHP\Per Directory Values, in the sub-keys corresponding to the path names. For example, configuration values for the directory c:\inetpub\wwwroot would be stored in the key HKLM\SOFTWARE\PHP\Per Directory Values\c\inetpub\wwwroot. The settings for the directory would be active for any script running from this directory or any subdirectory of it. The values under the key should have the name of PHP configuration directive and the string value. PHP constants in the values would not be parsed.
I'm not sure how useful this will be.
Take a look at ...
http://miasmatik.maladoc.org/doc.php?d=12&cid=129
The downside here is that it uses CGI rather than ISAPI. So no persistent DB connections.
On one of the pages on this site ...
"Note: with Microsoft IIS, it appears that the php.ini located in the php.exe directory is not taken into account and that PHP seeks it in C:\WinNT. This not existing file, it is the built-in configuration which is taken into account (which is defined within compiled php.exe). This problem does not occur under Apache."
So, maybe drop IIS and go for Apache.
Richard.