View Full Version : Troublesome PHP Install on Win2k3 IIS

11-22-2006, 04:24 PM
Would anyone like to throw in some lateral ideas on what could possibly foul up a PHP install on a Win 2k3 IIS server (.NET v1.1).

PHP 4.4.4 was originally installed, vanilla flavoured from php.net's msi installer. Although cgi, it basically worked (phpinfo() was fine) however calls to mysql functions threw 'procedure not found' errors.

As with all subsequent attempts in installing PHP, install.txt's directions were followed to a T along with php.net's recommendations for Win 2k3 IIS:

Extract win32php files to c:\php
Move files in c:\php\dlls and c:\php\sapi to c:\php
Edit System PATH .= ;c:\php

Edit php.ini:
extension_dir = c:\php\extensions (ext for v.5)
doc_root = c:\inetpub\wwwroot
cgi.force_redirect = 0

(even though system PATH includes c:\php)

Move php.ini to %systemroot%\.
Move php4ts.dll to %systemroot%\system32

Apply IUSR & IWAM perms to php.ini and php4ts.dll

Config IIS 6:
Web Service Extension = PHP -> %systemroot%\system32\php4ts.dll
Application Properties = .php -> %systemroot%\system32\php4ts.dll
(php.exe used in cgi mode)
Default doc = index.php, default.php

I've tried the following to get each php version to run properly:

PHP 4.3.11, 4.4.4 & 5.0.2 manual installs and 4.4.4 & 5.0.2 installers. All downloaded from php.net

Removing all previous version php files before upgrading/downgrading.

Trolling the registry and deleted stale entries left behind by installers.

Copying all dll and sapi files to %systemroot%\system32 folder.

System searches for duplicate php.ini and phpXts.dll files.

Used a dll dependency walker to test phpXts.dll's dependency files are found. (MSJAVA.dll wasn't, so I copied that over to the system).

Used a dupe dll app to find dupes.

Adding inifilepath to registry.

Mysql 4.1 was also installed before php. After installing php5, I found conflicting libmysql.dll files in mysql\bin and php\ directories. So I tried moving either one into %systemroot%\system32 and renaming the other. No change. I then uninstalled mysql just in case.

Downgrading to php v 4.3.11 (current version in place)

I also tried dozens of other possible solutions found on the net, none of which seem to change matters. All I can get now is a 404 error if php is in cgi mode or a "The specified procedure could not be found" error message if using dll's.

Any ideas on how to troubleshoot this further would be greatly appreciated.

11-22-2006, 04:32 PM
Do you have to use IIS as the web server?

11-22-2006, 04:40 PM
Do you have to use IIS as the web server?

Yup. Server also requires .NET

11-22-2006, 05:14 PM
This may help

11-22-2006, 05:23 PM
There are at least two errors that I see -

Edit php.ini:
extension_dir = c:\php The install.txt instructions state that this is c:\php\extensions for PHP4 and c:\php\ext for PHP5.

Config IIS 6:
Web Service Extension = PHP -> %systemroot%\system32\php4ts.dll
Application Properties = .php -> %systemroot%\system32\php4ts.dllFor cgi, the instructions state to use php.exe for PHP4 and php-cgi.exe for PHP5 for the first line. I am not sure what the second line is referring to.

I recommend that you use the isapi module version instead of the cgi version.

Even though the documentation states that mysql support is built-in in the latest PHP4 version (prior versions had a separate .dll) I had someone in a different forum that could not get PHP4.4.4 to talk to mysql (I don't recall if this was IIS based or CGI based) but they ended up going to the latest PHP5 version, which does work as advertised. For earlier PHP4 versions and PHP5 versions, after the extension_dir is set correctly, you must uncomment a line in the extensions section in php.ini to get the php_mysql.dll to load.

To get changes to php.ini to take effect, the server must be rebooted. In my experience of using IIS on WinXP, just stopping and starting the IIS web service does not cause changes to take effect.

Also, if you are making changes to php.ini and they don't seem to be having an effect, use your .php script with the phpinfo() statement and check near the top of the output where PHP says it is looking for the php.ini file.

11-22-2006, 05:40 PM
All of php4ts.dll's dependencies are present on the system. Including the valid ones mentioned. php_mysql.dll and php_mysqli.dll aren't required for php v.4 according to php.net; the functions are already compiled in.

11-22-2006, 05:53 PM
My bad on extension_dir value - it's a typo. The correct exe file paths were entered depending on the version (php.exe or php-cgi.exe).

"Application Properties = .php -> %systemroot%\system32\php4ts.dll" refers to adding the .php extension to home directory > configuration > app properties.

Server was always rebooted via net stop, net start. Changes to php.ini do not make any difference. I can rename php.ini or delete it, no change. The output remains the same "procedure cannot be found". This error message seems to output before php.ini is processed.