Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts

    Troublesome PHP Install on Win2k3 IIS

    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.
    Last edited by meth; 11-22-2006 at 04:42 PM. Reason: update for clarity
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.

  • #2
    New Coder
    Join Date
    Nov 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you have to use IIS as the web server?

  • #3
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts
    Quote Originally Posted by GeXus View Post
    Do you have to use IIS as the web server?
    Yup. Server also requires .NET
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.

  • #4
    New Coder
    Join Date
    Nov 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #5
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    2,958
    Thanks
    2
    Thanked 304 Times in 296 Posts
    There are at least two errors that I see -
    Code:
    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.

    Code:
    Config IIS 6:
    Web Service Extension = PHP -> %systemroot%\system32\php4ts.dll
    Application Properties = .php -> %systemroot%\system32\php4ts.dll
    For 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.
    Last edited by CFMaBiSmAd; 11-22-2006 at 04:28 PM. Reason: fixed wording
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #6
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts
    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.
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.

  • #7
    Regular Coder meth's Avatar
    Join Date
    Jan 2003
    Posts
    262
    Thanks
    0
    Thanked 9 Times in 9 Posts
    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.
    I do Web Design, Brisbane based.
    More time spent in PHP/MySQL Web Development.
    And Search Engine Optimisation takes up the rest of it.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •