PHP 5.3.8 Problems [Answered]RSS

26 replies

Last post Jan 30, 2012 07:13 AM by HCamper

  • PHP 5.3.8 Problems

    Sep 08, 2011 02:09 PM|Kalio|LINK

    I moved this discussion from the WPI forum as it relates to a problem with PHP and FastCGI...

     Basically, I have a W2K8R2 server running Drupal (7.8), which utilizes PHP/FastCGI and IIS 7.5. The problem is that any version of PHP over 5.3.6 causes most of my PHP pages in Drupal to return a 500 error, which always results in two things:

     1. The application log reports the following:

    Faulting application name: php-cgi.exe, version: 5.3.8.0, time stamp: 0x4e537f4b
    Faulting module name: MSVCR90.dll, version: 9.0.30729.4940, time stamp: 0x4ca2ef57
    Exception code: 0xc0000005
    Fault offset: 0x0003af1c
    Faulting process id: 0x5e0
    Faulting application start time: 0x01cc6e500c8224e3
    Faulting application path: C:\Program Files (x86)\PHP\v5.3\php-cgi.exe
    Faulting module path: C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4940_none_50916076bcb9a742\MSVCR90.dll
    Report Id: 4ae1b50f-da43-11e0-bdc3-00155d646402

    2. IIS failed request logging reports that 'The FastCGI process exited unexpectedly'.

     The application pool is set to classic mode using the v2.0 .NET framework and I have checked for permission problems using Process Monitor. Both the x86 and x64 VC09 SP1 runtimes are installed. I also have PHP Manager installed but it does not report any problems, and phpinfo() runs fine.

     The most frustrating part about this problem is that I can not get any logging out of PHP itself, despite turning on logging options for PHP and FastCGI. If I stay with version 5.3.6, everything works fine. Unfortunately there is a vulnerability with PHP prior to 5.3.8, so I am required to get PHP patched or shut down our Drupal development, and I have spent the last two days working on this problemw ith no success.

    PHP Drupal

  • Re: PHP 5.3.8 Problems

    Sep 08, 2011 02:43 PM|HCamper|LINK

    Hi,

    Thanks for the information and moving the post / thread.

    I suggest that you look at the php.ini settings for Time / Zone and error message display.

    Guide for Time / Zones http://www.php.net/manual/en/function.date-default-timezone-set.php .

    The post install steps for PHP are a problem.

    You might check this Forum post http://forums.iis.net/p/1180851/1992846.aspx#1992846 it has the extensions

    and much of the current problems covered.

    I will help after you check the above items.

    Martin

     

     

    PHP php.ini_config php.ini php-cgi.exe 500 - Internal server error php log errors

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Sep 08, 2011 03:38 PM|Kalio|LINK

    Thanks for helping out, Martin. I checked the time zone setting both in the php.ini file and on the system, both seem to be okay. Here are all of my FastCGI-related settings in the php.ini file (which were mostly set up by WPI automatically, under [WebPIChanges]):

    error_log="C:\Windows\temp\php53_errors.log"
    upload_tmp_dir=C:\Windows\temp
    session.save_path=C:\Windows\temp
    cgi.force_redirect=0
    cgi.fix_pathinfo=1
    fastcgi.impersonate=1
    fastcgi.logging=1
    max_execution_time=300
    date.timezone=America/New_York
    extension_dir="C:\Program Files (x86)\PHP\v5.3\ext\"

    I made sure that paths and permissions are correct.

  • Re: PHP 5.3.8 Problems

    Sep 08, 2011 03:55 PM|Kalio|LINK

    Also, as a quick test, I tried using a very minimal php.ini file to see what would happen, but it did not change anything.

    [PHP]
    log_errors = On

    [WebPIChanges]
    error_log="C:\Windows\temp\php53_errors.log"
    upload_tmp_dir=C:\Windows\temp
    session.save_path=C:\Windows\temp
    cgi.force_redirect=0
    cgi.fix_pathinfo=1
    fastcgi.impersonate=1
    fastcgi.logging=1
    max_execution_time=300
    date.timezone=America/New_York
    extension_dir="C:\Program Files (x86)\PHP\v5.3\ext\"

    [ExtensionList]
    extension=php_mysql.dll
    extension=php_mysqli.dll
    extension=php_mbstring.dll
    extension=php_gd2.dll
    extension=php_gettext.dll
    extension=php_curl.dll
    extension=php_exif.dll
    extension=php_xmlrpc.dll
    extension=php_openssl.dll
    extension=php_soap.dll
    extension=php_pdo_mysql.dll
    extension=php_pdo_sqlite.dll
    extension=php_imap.dll
    extension=php_tidy.dll
    extension=php_pdo_sqlsrv.dll
    extension=php_sqlsrv.dll

    [PHP_WINCACHE]
    extension=php_wincache.dll

  • Re: PHP 5.3.8 Problems

    Sep 08, 2011 04:42 PM|HCamper|LINK

    Hi,

    That looks ok for php.ini settings.

    You can comment out extensions

    ;extension=php_xmlrpc.dll

    ;extension=php_exif.dll

    ;extension=php_imap.dll

    for now.


    Next  step is to make sure PHP Manager

    and your  FastCGI and Recycling settings match and the Handlers

     http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-7/ 

    and that you have a Windows System one or more

     EnvironmentVariables name="PHPRC" for the Web Sites and the paths as show in the in the guide.

    Martin


     

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Sep 09, 2011 09:10 AM|Kalio|LINK

    Ok, I commented those out and re-reviewed the guide you linked for configuring FastCGI in IIS. PHP_FCGI_MAX_REQUESTS and instanceMaxRequests are both set to 10000 and the PHPRC value is set correctly. I could not find any problems with the FastCGI settings or in PHP Manager.

    Prehaps one more thing worth noting... if I comment out php_pdo_sqlsrv.dll and php_sqlsrv.dll in the php.ini file, I get an error message for all PHP pages in Drupal instead of just some of them, though this is to be expected because I'm using an SQL database. The error is "PHP Fatal error:  Undefined class constant 'SQLSRV_ATTR_DIRECT_QUERY' in D:\inetpub\wwwroot\Home\includes\database\sqlsrv\database.inc on line 59". The interesting thing about this, though.. is the fact that it is, at least, actually writing the error to the error log file. So we know that there should not be a problem with error log, since it will write error events if I 'purposely break things'. I still wish I knew why my original problem with these 500 errors does not write anything in the log, or why it only effects some PHP pages but not others.

  • Re: PHP 5.3.8 Problems

    Sep 09, 2011 09:20 AM|Kalio|LINK

    Forgot to add, open_basedir was missing from my php.ini file so I added it with it and set it to the base directory of my website.

  • Re: PHP 5.3.8 Problems

    Sep 09, 2011 10:30 AM|HCamper|LINK

    Hi,

    So your getting SQL Driver and extension errors. You updates the open_basedir thats ok.

    Could you look at the steps for installing the SQL Server Driver for PHP http://learn.iis.net/page.aspx/699/install-the-sql-server-driver-for-php/ 

    download the latest version from Microsoft Download Center.

    Use the guide for the SQL Server Driver for PHP  add to php.ini you can have both MySQL Server Extension and SQL Server 2008 in

       the php.ini.

    After you finish the configuration you need to verify / test  that php.exe is operating correct

    at the command line. Then verify that php can run in IIS Server using test.php.

    Create a test.php at C:\inetpub\wwwroot\test.php with <? phpinfo(); ?>  it will be used just for verification

     you should move it to some other place later for security and safety.

    Start from an Elevated Command prompt > cd C:\inetpub\wwwroot then php /? for help then

        run php.exe test.php you should display the php information and there should be no errors.

     If there are errors check the php-errors.log and you can post the information in the forum.

    If there are no errors then browse to the test.php using a browser for http:// localhost / test.php

           which should display the php information as decorated html.

    If you get the php information display then php is working.

    Sorry if this takes time but each part needs to be verified to to find who or what is failing.

    If the tests have worked then use the PHP manager to peform the same verifications.

    Note: Each time you run the tests in the IIS Server you should do a restart

    you may find that php-cgi.exe is running one or more times in the Task Manager.

    Martin

     

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Sep 09, 2011 03:37 PM|Kalio|LINK

    I already have SQL driver for PHP installed and it shows up in phpinfo(). I believe the reason for the error was because I commented out the SQL driver extensions (php_pdo_sqlsrv.dll and php_sqlsrv.dll) but only did so at a test. I was merely trying to prove that error logging was capable of working by doing this.

     I have never had a problem with phpinfo(), though I did as you said and created my own 'test.php' file, and got the same result as I do when I check phpinfo() in PHP Manager. That is to say, there are no problems to report. I always run the iisreset command after every change I make, and so far I have not found duplicate copies of php-cgi.exe running.

     

    I will try obtaining the latest version of the PHP SQL drivers and reinstalling them though just in case...

  • Re: PHP 5.3.8 Problems

    Sep 11, 2011 08:57 AM|HCamper|LINK

    Hi,

    Just in case your still looking http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=20098 Microsoft Download Center

     for the SQL PHP Drivers 2.0 release. Ok. So the PHP engine is working so far so good.:D.

    The remaining steps are with problems related to the the Blog the files folders permissions and the "Application Pool" and if it is used

    urlRewrite Rules or files.

    Part of the pre-install for most of the Blogs and CMS programs is to check that the "IUSR" "IIS_USRS" have full access

    read,execute,list permissions to the folders. In some cases you need to allow some files to have write permissions.

    The permissions settings are usually convered in the Blog or CMS install guide.

    Check that any required Temp Upload Download folders have been created as part of pre-install and that the IUSR,IIS_USRS

    have correct permissions.

    Check that the SQL Server ( MySQL Server or SQL 2008 R2 Server)

     has a user who has rights to the existing database or the empty database that will be used in the install / setup for the Blog CMS.

    Then after verifying the steps above check that the "Application Pool" is set to the correct version of the Dot Net Framework

    the Identity and if it is "Classic" or Integrated". The Blog or CMS Install guide usually has information for what is to be set.

    You can start with Net 2.0 and "Classic" mode and test if that works.

    One of the problems you may be having with the IIS Server is the "Inherit" permissions setting.

    If you go to the Security Tab and Advanced section and using Windows Explorer or IIS Manager look at the check box

    for "Inherit" Permissions change as needed.

    Martin

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Sep 12, 2011 10:42 AM|Kalio|LINK

    I installed the SQLSRV drivers for PHP but it looks like they are the same version I already had. It did not make a difference. I am somewhat convinced it may be a problem related to the SQL in some way, as it seems only pages that perform database operations seem to be the ones generating the 500 error...

     I am not sure what you mean by the blog or CMS install guide/program, but I know my application pool settings are correct and I pretty much ruled out file permissions by using the SysInternals process monitor tool. There are no problems with permissions on the SQL server either.

    Again, I feel it's worth noting that if I revert PHP back to 5.3.6, everything works. At this point.. it just doesn't seem like it could be a configuration problem. It really looks like there must be a genuine problem with PHP 5.3.7+ and some combination of the following:

    SQLSRV VC09 driver for PHP 2.0.1
    Drupal 7.6+
    SQLSRV modules for Drupal 7.x-1.1
    IIS 7.5
    Windows Server 2008 R2 SP1 64-bit
    Microsoft SQL 2008 SP2 64-bit

    Is anyone out there using the same combination of software, I wonder?

     I think I will try uninstalling everything and rebuilding the Drupal enviroment from scratch to see if I end up with the same problem.

  • Re: PHP 5.3.8 Problems

    Sep 12, 2011 11:10 AM|HCamper|LINK

    Ok, So the SQL PHP Driver is ok.

    The pages for database may be the problem agreed and maybe plugins libaries ro others that are part of the directories. 

    What I suspect is the seperate permissions for Folders File NTFS Systems permissions in the Drupal Site are a problem. 

    You can check using Windows Explorer and the Security Tab.

    If you use IIS Manager then with Content View instead of Features View.

    Sorry for the generic reference CMS / Blog Drupal http://drupal.org/documentation/install guide.

    The Web Platform suggested guide for Drupal http://learn.iis.net/page.aspx/505/install-drupal-on-iis/ on IIS Server.

    Yes This "Again, I feel it's worth noting that if I revert PHP back to 5.3.6" is "everything works". is true.

    If you decide to move on or revert:

    You should leave the PHP version 5.3.8 install as it it is working.

    Since you have the PHP Manager you can switch to the PHP 5.3.6 version as needed.

    You could start with a fresh archive or install of the Drupal and see if that works.

    Thank you sticking through this it is time consuming and fustrating.:D

    Martin

     

     

     

     

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Sep 17, 2011 06:32 PM|HCamper|LINK

    Hi Kalio,

    Have you reverted back

    or made progress ?

    Martin

     

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Sep 26, 2011 10:51 AM|Kalio|LINK

    Hi Martin,

     

    Sorry, I was out for the past week or so. I haven't had a chance to work on this much more since then, but will probably be trying to rebuild everything later this week.

  • Re: PHP 5.3.8 Problems

    Sep 26, 2011 11:08 AM|HCamper|LINK

    Hi,

    No problem @@.

    Martin

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Oct 03, 2011 11:05 AM|xxrsdsdk209|LINK

    I've got the same problem, only difference I see is that we are trying to connect to MS SQL 2005 but still getting

     

    Fatal error: Undefined class constant 'SQLSRV_ATTR_DIRECT_QUERY' in E:\inetpub\wwwroot\cprint\dev\includes\database\sqlsrv\database.inc on line 59

  • Re: PHP 5.3.8 Problems

    Oct 03, 2011 11:43 AM|HCamper|LINK

    Hello @ xxrsdsdk209,

    Open a new thread your have problems with php code and the SQL PHP Driver.

    Martin

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Oct 04, 2011 07:55 AM|panmanphil|LINK

    I am having a very similar problem. Exact same error message, though the version of MSVCR90.dll is slightly different. Same exception code. Some other background. Only the fault event log entry , nothing in the php error log. I previously had setup Drupal 6 with mysql and all was (and is working so long as I change extensions in php.ini). What I'm trying to do is setup Drupal 7 with Sql Server so I can fit all this in with the rest of our Windows environment. I was able to install drupal 7 to mysql on this box so I really think the problem is in the sqlsrv PHP driver. I have duplicated this problem on Vista 64bit and Windows 7 64 bit. The install succeeds up to a point, not always exactly the same point based on running my sql server trace, and fails with a message about unable to set named parameters. I have the latest php, the lastest sql server php driver from MS, the lastest version of drupal and the latest version of the drupal sqlsrv database module. I commented out the portion of the drupal install that was failing, inserting registry files in the drupal database, and the install proceeds farther and then fails the same way. I am going to try the ODBC driver this morning and see if I get a different result.
  • Re: PHP 5.3.8 Problems

    Oct 04, 2011 11:47 AM|HCamper|LINK

    Hi @ panmanphil,

    Exact same error post the information.

    What version of the Visual Studio run time installer for the "MSVCR90.dll" you have updates and security patches ?

    Same Exception code post the information.

    Nothing in php-error.log that is good.

    You have this " fails with a message about unable to set named parameters" you should check

    Brian Swans Blog for use of the PHP Sql Server driver for parameters.

    Have you checked the SQL Server PHP driver Forum http://social.msdn.microsoft.com/Forums/en-US/sqldriverforphp/thread/3b38a360-047c-4b31-8531-6978d328f73d .

    Martin

     

     

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Oct 04, 2011 10:13 PM|panmanphil|LINK

    Here is the full error. Version of MSVCR90 is listed. My computer is fully patched. I also looked at the blog you mentioned, but so far haven't found any clues. Thanks for the link to the sql server driver forum, I'll check in there as well. Log Name: Application Source: Application Error Date: 10/4/2011 6:22:37 AM Event ID: 1000 Task Category: (100) Level: Error Keywords: Classic User: N/A Computer: ASUS-LT Description: Faulting application name: php-cgi.exe, version: 5.3.8.0, time stamp: 0x4e537f4b Faulting module name: MSVCR90.dll, version: 9.0.30729.6161, time stamp: 0x4dace5b9 Exception code: 0xc0000005 Fault offset: 0x0003ae7a Faulting process id: 0x8bc Faulting application start time: 0x01cc8287613cdae8 Faulting application path: C:\Program Files (x86)\PHP\php-cgi.exe Faulting module path: C:\Windows\WinSxS\x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.6161_none_50934f2ebcb7eb57\MSVCR90.dll Report Id: 29979694-ee7b-11e0-afe1-00235421655d
  • Re: PHP 5.3.8 Problems

    Oct 04, 2011 10:43 PM|HCamper|LINK

    Hi,

    For the Microsoft Foundation Library errors "MSVCR90.dll, version: 9.0.30729.6161"

           visit the Microsoft Download Center and Download the installer(s) for the Visual Studio 2008 runtimes.

    Save the files to hard disk add or modify the file name from the download center

     VS2008-SPX-vcredist-NN.exe NN being one for X86 and X64 SPX if this is a service pack. You should have at least two packages. 

    Do not run the Visual Studio 2008 runtime installers online id it asks to repair or remove take the remove option first.

    After the Visual Studio 20008 runtime installer has finished run the installer again.

    Look at Search (Google or Bing) on the "Faulting module name: MSVCR90.dll, version: 9.0.30729.6161" results.

     http://www.google.com/search?q=Faulting+module+name%3A+MSVCR90.dll%2C+version%3A+9.0.30729.6161&rls=com.microsoft:en-us&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1&rlz=1I7GUEA_en .

    It would appear that one or more Software Installers can corrupt the MFC C++ libraries.

    For the PHP SQL Driver coding use Brian Swans examples and the MSDN Documentation.

    A very old  is the  standard "Hello world" http://en.wikipedia.org/wiki/Hello_world_program  this may seem dumb

    seasoned programmers use this method.

     For PHP SQL Driver this is  "Hello Sql Server" then use the working examples to check your code.

    Martin

     

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Oct 06, 2011 09:44 PM|panmanphil|LINK

    The answer is a bug in the Drupal Sql Server driver that sits on top of Drupal's PDO implementation and Microsoft's Sql Server driver. Sending an empty command to sql server, which happens when the transaction savepoint functionality is called by Drupal, causes the fault. Details are here: http://social.technet.microsoft.com/Forums/en-US/sqldriverforphp/thread/2429f26b-287e-474e-8472-2c40f2a6ba10 thanks everybody for the ideas and help.
  • Re: PHP 5.3.8 Problems

    Oct 06, 2011 10:06 PM|HCamper|LINK

    Hi @ panmanphil,

    Thanks for the update & information :D. 

    So you and  the SQL Server PHP Driver Forums deserve a big cheers :)

    So the overlay code by Drupal and PDO is "beating" up the Microsoft driver.

    I still would keep a watch on the Visual Studio 2008 runtime installs.

    There are alot of conflicts with third party vendors and the runtimes.

    Martin

     

     

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Oct 13, 2011 04:22 PM|Kalio|LINK

    Thank you so much panmanphil! This did the trick and solved my problems. I never did get a chance to rebuild our whole enviroment from scratch, but thankfully, I won't need to. Thanks again!

    In case anyone needs it, here is a direct link to the special patch made for the Drupal SQL driver:

    http://drupal.org/node/1300312

  • Re: PHP 5.3.8 Problems

    Oct 14, 2011 08:45 PM|HCamper|LINK

    Hello @ xxrsdsdk209,

    The other users in this thread so far have found a solution.:D.

    Could you post the PHP code or post the IIS server log errors for failures or success ?

    The alternate for IIS 7.0 IIS 7.5 Server is Enable and Turn on "Failed Request Tracing"

    You can ( Google or Bing ) for the guides for FRT which should lead the the IIS Net Library.

    Could you re-check the "Application Pools" and Permissions for Accounts and users.

    Read the IIS Net Library guides:

    http://learn.iis.net/page.aspx/624/application-pool-identities/ 

    http://learn.iis.net/page.aspx/140/understanding-built-in-user-and-group-accounts-in-iis-7-and-above/ .

    Martin

     

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Nov 22, 2011 11:16 AM|HCamper|LINK

    Hi,

    The PHP 5.3.8 thread  http://forums.iis.net/p/1182091/1997952.aspx#1997952 special case SQL Driver for PHP.

    Update this thread issues related to PHP 5.3.8

    regards,

    Martin

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011
  • Re: PHP 5.3.8 Problems

    Jan 30, 2012 07:13 AM|HCamper|LINK

    Hi Kalio 

    PHP 5.3.8 Problems and issues get the latest version and release.

    http://learn.iis.net/page.aspx/773/how-to-install-the-microsoft-web-platform-for-php/ How-To Install.

    PHP Manager http://learn.iis.net/page.aspx/944/using-php-manager-for-iis-to-setup-and-configure-php/

    http://forums.iis.net/t/1186508.aspx IIS 7 - Forum-FastCGI-PHP -Information.

    TIA,

    Martin Rasch

     

    Windows and Linux work Together IT-Pros
    Community Member Award 2011