Previous Next

Thread: PHP5 IIS6 Permissions Problem?

Last post 02-20-2008 11:53 AM by Antnee. 11 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (12 items)

Sort Posts:

  • 02-05-2008, 8:20 AM

    • Antnee
    • Top 500 Contributor
    • Joined on 07-11-2007, 7:36 AM
    • Posts 10

    PHP5 IIS6 Permissions Problem?

    Hi guys

    Not sure if this is the right place to post but can't see anywhere any more suitable.

    Basically, we've been installing a web-app on a domain controller at work. Previously the app ran on WAMP but the new server has to run IIS, though PHP and MySQL is acceptable for now.

    We've jumped through hoops to get it working as well as it is now, but we've hit a few snags which seem common, but none of the solutions work for us.

    We were having problems where the MySQL extensions for PHP could not be loaded because of access rights. When we look at a phpinfo() output the MySQL information is completely missing. This happens with any user set in the application pool with the exception of Administrator. When we make that user the one that runs that application pool then the MySQL extensions load fine and the whole system works perfectly. Even if we change it to another admin user the system still won't work.

    Obviously we don't want the Administrator account being operated by IIS so would appreciate any ideas you guys have.

    Cheers

    Anthony

  • 02-05-2008, 2:30 PM In reply to

    • Antnee
    • Top 500 Contributor
    • Joined on 07-11-2007, 7:36 AM
    • Posts 10

    Re: PHP5 IIS6 Permissions Problem?

    I see the thread has been moved to the PHP community. Do we feel that user privileges in the application pool is a PHP problem? That's what we figured was the problem, rather than PHP itself.

    Cheers

  • 02-05-2008, 3:16 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 1,225

    Re: PHP5 IIS6 Permissions Problem?

    On the surface, this seems to be an issue with the right php.ini file or mysql extension being loaded by php and so would seem like a php problem - use something like procmon to figure out where php is trying to load the ini file and mysql extension from.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 02-05-2008, 3:35 PM In reply to

    • Antnee
    • Top 500 Contributor
    • Joined on 07-11-2007, 7:36 AM
    • Posts 10

    Re: PHP5 IIS6 Permissions Problem?

    We've already got that information from the simple phpinfo() function that we've run on a page that tells us that the correct PHP.INI file (g:\php\php.ini) is loaded and that the extensions are being loaded from the correct directory also (g:\php\ext\). The full extension name is also correct and does not mention being missing, but rather that access is denied.

    I tried a couple of other modules to make sure that they work and the EXIF module for example works fine, it's just the MySQL one.

    I have seen around that there can be problems when running on a Domain Controller, which isn't an ideal situation but we're working with what we're given at the moment. If that setup causes an ireperable situation then we'll just have to pull it and return to WAMP, which in fairness was my preference in the first place.

    Thanks again 

  • 02-06-2008, 2:39 AM In reply to

    • Antnee
    • Top 500 Contributor
    • Joined on 07-11-2007, 7:36 AM
    • Posts 10

    Re: PHP5 IIS6 Permissions Problem?

    Back at work; have reset to NETWORK SERVICE and we've lost MySQL support. Using ProcMon we've found that all entries for php_mysql.dll are handled by w3wp.exe and all are successful so I'm not sure what is having access failures. PHP itself? Nothing with PHP in the name appears in ProcMon.

    Stuck on how to proceed now

  • 02-06-2008, 6:37 AM In reply to

    • Antnee
    • Top 500 Contributor
    • Joined on 07-11-2007, 7:36 AM
    • Posts 10

    Re: PHP5 IIS6 Permissions Problem?

    Enabled IIS5 Isolation Mode and now it works. Not ideal but it works so that's good 

  • 02-06-2008, 1:38 PM In reply to

    Re: PHP5 IIS6 Permissions Problem?

    Do you have an error message to post?

  • 02-06-2008, 2:13 PM In reply to

    • Antnee
    • Top 500 Contributor
    • Joined on 07-11-2007, 7:36 AM
    • Posts 10

    Re: PHP5 IIS6 Permissions Problem?

    The only errors we ever got were either "SERVICE UNAVAILABLE" on a webpage or the PHP log file (we called it php_error.log) would have an entry something along the lines of:

    PHP Warning: PHP Startup: Unable to load dynamic library 'G:\PHP\ext\php_mysql.dll' - Access is denied. in Unknown on line 0
    PHP Warning: PHP Startup: Unable to load dynamic library 'G:\PHP\ext\php_mysqli.dll' - Access is denied. in Unknown on line 0

    We figured it was permissions related since it worked OK once the Administrator user was responsible for the application pool. Switching back to NETWORK SERVICE or IWAM_<machinename> resulted in the PHP errors in the logs again.

    Obviously IIS5 has no application pools so in reverting to the isolation mode we ruled that bit out and it all worked OK. Annoyingly though we've been told today that we're to switch back to WAMP on an XP Pro box and all the work we've done over the past two days (which obviously resulted in a working system in the end) was for nought. Poo

    Oh, and for reference we were using PHP via ISAPI and not CGI, the correct PHP.ini file was being read and all changes were reflected in phpinfo(). The ONLY thing that wasn't working properly were the MySQL extensions. EVERYTHING else worked OK, including other extensions

     

  • 02-20-2008, 6:35 AM In reply to

    Re: PHP5 IIS6 Permissions Problem?

    Too late now, but did you ever look to see if you had multiple copies of the MySQL extension at all?

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 02-20-2008, 9:58 AM In reply to

    • Antnee
    • Top 500 Contributor
    • Joined on 07-11-2007, 7:36 AM
    • Posts 10

    Re: PHP5 IIS6 Permissions Problem?

    We didn't look, no. Do you mean multiple versions of the same extension or different ones?  

  • 02-20-2008, 11:41 AM In reply to

    Re: PHP5 IIS6 Permissions Problem?

    Same extension. I've seen PHP get a bit stroppy before when multiple versions of a file exist and are accessable via the PATH variable, however not when dealing with extensions. Definately in the weird basket. I'd suggest replacing the file if it weren't for the fact it works when given an elevated account to work with. Being a domain controller could be an area for further investigation as off the top of my head I'm not sure what policy/permission changes are made to the service accounts (because as a rule I never have IIS on a DC). Could be that using another webserver is best given your particular circumstances.

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 02-20-2008, 11:53 AM In reply to

    • Antnee
    • Top 500 Contributor
    • Joined on 07-11-2007, 7:36 AM
    • Posts 10

    Re: PHP5 IIS6 Permissions Problem?

    Gotcha. Well for now we're back to running a WAMP install on a separate machine which was always my preferred option anyway so I'm happy. By the time we come to require IIS again I think we'll be looking at the ASP.NET port of the system that the company has been threatening for the past year or so. We'll see though.

    Although I've pretty much washed my hands of the issue now, hopefully if anyone else ever has a problem then they can use your advice, so thanks
     

Page 1 of 1 (12 items)
Page view counter