I have a Windows 2008 VPS. I have installed IIS on it.
PHP stops working randomly on my IIS Windows 2008 server with no error.
I created a ticket with my hosting provider, they are saying -
As discussed, we could see PHP error in event-log:
https://forums.iis.net/t/1174646.aspx?Faulting+application+php+cgi+exe+version+5+2+14+14+time+stamp+0x4c4eabdc+faulting+module+xxxxxx
https://www.experts-exchange.com/questions/29049180/Faulting-application-name-php-cgi-exe-Exception-code-0xc0000005.html
------------------------------------
Log Name: Application
Source: Application Error
Date: 30-06-2018 22:30:30
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: Sapphire33615rb
Description:
Faulting application php-cgi.exe, version 5.5.38.0, time stamp 0x578fc02c, faulting module kernel32.dll, version 6.0.6002.19623, time
stamp 0x56ec36ff, exception code 0xc0000005, fault offset 0x0003fdb6,
process id 0x1dfc, application start time 0x01d410921634bfc2.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Application Error" />
<EventID Qualifiers="0">1000</EventID>
<Level>2</Level>
<Task>100</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2018-06-30T17:00:30.000Z" />
<EventRecordID>980539</EventRecordID>
<Channel>Application</Channel>
<Computer>Sapphire33615rb</Computer>
<Security />
</System>
<EventData>
<Data>php-cgi.exe</Data>
<Data>5.5.38.0</Data>
<Data>578fc02c</Data>
<Data>kernel32.dll</Data>
<Data>6.0.6002.19623</Data>
<Data>56ec36ff</Data>
<Data>c0000005</Data>
<Data>0003fdb6</Data>
<Data>1dfc</Data>
<Data>01d410921634bfc2</Data>
</EventData>
</Event>
You can create dump file of w3wp.exe and it will create dump file at C:\Users\Administrator\AppData\Local\Temp\2 for further analysis.
I don't see any error in my PHP log files.
Related
trying to use LoadFile "C:/ProgramFiles/PostgreSQL/15/bin/libpq.dll" in the httpd.conf file.
I keep getting this from the error logs:
Log Name: Application
Source: Apache Service
Date: 1/24/2023 6:46:09 PM
Event ID: 3299
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: Cedric-PC
Description:
The Apache service named reported the following error:
>>> httpd.exe: Syntax error on line 542 of C:/Apache24/conf/httpd.conf: Cannot load C:/ProgramFiles/PostgreSQL/15/bin/libpq.dll into server: The specified module could not be found. .
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Apache Service" />
<EventID Qualifiers="0">3299</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2023-01-24T23:46:09.4847737Z" />
<EventRecordID>52674</EventRecordID>
<Correlation />
<Execution ProcessID="0" ThreadID="0" />
<Channel>Application</Channel>
<Computer>Cedric-PC</Computer>
<Security />
</System>
<EventData>
<Data>The Apache service named</Data>
<Data>
</Data>
<Data>reported the following error:
>>></Data>
<Data>httpd.exe: Syntax error on line 542 of C:/Apache24/conf/httpd.conf: Cannot load C:/ProgramFiles/PostgreSQL/15/bin/libpq.dll into server: The specified module could not be found.</Data>
<Data>
</Data>
<Data>
</Data>
<Data>
</Data>
<Data>
</Data>
<Data>
</Data>
</EventData>
</Event>
Everything is running x64. Apache is on VC15. PostgreSQL is 15.
I have no idea how to troubleshoot this.
EDIT:
Syntax error. Needed a space between "Program Files"...
There are a couple things I noticed with the information you have provided.
Firstly, "C:/ProgramFiles/" is not a valid directory path.
It is typically "C:/Program Files/" or "C:/Program Files (x86)/"
I recommend copy/paste the folder path from the Windows explorer directory when you need to specify an absolute path like this.
Second, with Apache, you cannot load any arbitrary DLL file.
It must be a compiled library that is built for Apache, typically "mod_" will always be in it's name.
Finally,
Since the tag php is part of your post, I will assume that is what your web application is written in.
Normally, you would load an extension within php, in the php.ini file.
Look for your php.ini file within the installation directory.
Find the lines
extension=php_pgsql.dll
extension=php_pdo_pgsql.dll
Uncomment one, or both of them. Which ever fits your needs.
You may need to direct your PATH environment variable to the location where libpq.dll is located to have php find it.
I have worked in IT my entire life, and have been using Apache and php for most of that time.
Best of luck.
on my Win 10 machine i would like to use PHP on IIS. I went through different tutorials to get it to work but currently when i call the index.php file i got an blank page and the response is only the content of the php file (see this in browser dev tools).
content of the file:
`
<?php
phpinfo();
?>
`
Result
what i have done is:
installed CGI under Windows features
php 8.1.2 x86 Non thread safe unzipped under C:\php
php.ini adjusted like described in the tutorial(s)
linked the directory under environment variables to C:\php
set the handler mapping for php in IIS
checked the fast cgi module in IIS
I also activated the Failed Requested Trace in IIS and the outcoming log had following section:
For me it looks good, or i am wrong? If its helpful i can post the whole .xml, but it is very large.
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>4</Level>
<Opcode>43</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2022-11-15T15:58:47.038Z"/>
<Correlation ActivityID="{8000000A-0005-FF00-B63F-84710C7967BB}"/>
<Execution ProcessID="5540" ThreadID="1392"/>
<Computer>SRV01</Computer>
</System>
<EventData>
<Data Name="ContextId">{8000000A-0005-FF00-B63F-84710C7967BB}</Data>
<Data Name="OldHandlerName"></Data>
<Data Name="NewHandlerName">PHP_via_FastCGI</Data>
<Data Name="NewHandlerModules">FastCgiModule</Data>
<Data Name="NewHandlerScriptProcessor">C:\php\php-cgi.exe</Data>
<Data Name="NewHandlerType"></Data>
</EventData>
<RenderingInfo Culture="de-DE">
<Opcode>HANDLER_CHANGED</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{D42CF7EF-DE92-473E-8B6C-621EA663113A}</EventGuid>
</ExtendedTracingInfo>
</Event>
I'm running a WordPress multisite(4.5.3) on Windows IIS (8.5.96).
Every now and then the server crashes with a Wincache error. I have updated both PHP and Wincache components on the server. Because at the moment I have to observe the server 24/7.
Faulting application name: php-cgi.exe, version: 5.6.22.0,time stamp: 0x57468660
Faulting module name: php_wincache.dll,version: 1.3.7.10, time stamp: 0x56ccce50
Exception code: 0xc0000005
Fault offset: 0x00015247
Faulting process id: 0x8cc
Faulting application start time: 0x01d1f8244e589ffc
Faulting application path: C:\Program Files (x86)\PHP\v5.6\php-cgi.exe
Faulting module path: C:\Program Files (x86)\PHP\v5.6\ext\php_wincache.dll
Report Id: 7fbf700b-6418-11e6-80cc-005056b77a12
Faulting package full name:
Faulting package-relative application ID:
Server:
-Windows Server 2012 R2 Standard
-Installed memory Ram 4 Gb
-Php-cgi.exe (5.6.22.0)
-Wincache.dll (1.3.7.10)
IIS:
-IIS 8.5.96
-Php 5.6
IIS Setup:
-Idle timeout 300
-Activity timeout 300
-Request timeout 300
-Application pool > Recycling 20 min.
-Application pool > Idle time-out 18 min.
Wordpress and plugins used:
-Wp multisite 4.5.3
-Atom Linkedin (1.0.0)
-Contact form 7 (4.3.1)
-Custom Facebook Feed (2.3.10)
-Redirection (2.4.3)
-Rename wp-login (2.5.5)
-Revolution Slider (5.0.6)
-W3 Total Cache (0.9.4.1)
-Wordfence Security (6.1.14)
-WordPress MU Domain Mapping (0.5.5.1)
-WP-Mail-SMTP (0.9.5)
-Yoast SEO (3.0.7)
Is it a server issue or perhaps a misconfiguration? Or is it a php, WordPress or any other software issue?
Not sure whether this should be an answer or an comment, but here goes.
The exception code 0xc0000005 often means a shared memory access violation. At various places you find information about adding
wincache.namesalt=0x200000
to your configuration. This is a shared memory address to store objects in.
On the other hand: I'm using the same WinCache version in my environment, but it isn't used much (shared hosting). The clients use OPCache, and with OPCache the same exception code occurs frequently. It became less when I added
opcache.mmap_base=0x20000000
to our PHP.ini configuration, but it still isn't over.
The shared memory violation does not happen with PHP 7. If you can, switch to PHP 7.
Some reference links:
https://secure.php.net/manual/en/opcache.configuration.php#ini.opcache.mmap-base , https://www.apachelounge.com/viewtopic.php?p=29838#29838 , https://secure.php.net/manual/en/wincache.configuration.php#ini.wincache.namesalt , https://www.saotn.org/php-wincache-on-iis/
I am running around 50 sugar CRM running sites on the following setup -
IIS 7.5
MS-SQL 2008 (Seperate Server)
PHP 5.3.26
On average 5 out of 50 of the applications crash a day, and I have to restart the application pool to bring the site back up. I have asked end users what they were doing before the crash in an attempt to replicate this in a test environment. However I cannot seem to do it. I can only assume that I cannot do this in my test environment as it's under a lot less load.
I am pushing our development team to upgrade to the latest version of PHP for security and performance reasons, however my plea is falling on deaf ears.
Here is the error that I'm getting. Any advice at all will be appreciated.
Faulting application name: php-cgi.exe, version: 5.3.26.0, time stamp: 0x51af72a9
Faulting module name: kernel32.dll, version: 6.1.7601.18409, time stamp: 0x53159a85
Exception code: 0xc0000005
Fault offset: 0x00011359
Faulting process id: 0x1aac
Faulting application start time: 0x01cfa72d28b47c94
Faulting application path: C:\Program Files (x86)\PHP\v5.3\php-cgi.exe
Faulting module path: C:\Windows\syswow64\kernel32.dll
Report Id: 8d025994-132e-11e4-b2f1-005056b32471
I've followed the directions here: Using FastCGI to Host PHP Applications on IIS 7 to configure Windows 2008, PHP with IIS 7 and FastCGI, and I'm running into issues. The PHP version is 5.3.8. I've setup the Handler Mappings on IIS, and created a test page, though the page doesn't return anything except for a 500 error. I've ensured that PHP works, from the command line I get a response when I enter:
php -version.
That said, I've turned on Failed Request Tracing Rules for php pages, and when I browse through the error log, I see things like:
<EventData>
<Data Name="ContextId">{00000000-0000-0000-0200-0080010000F6}</Data>
<Data Name="ModuleName">FastCgiModule</Data>
<Data Name="Data1">FASTCGI_RESPONSE_ERROR</Data>
<Data Name="Data2">PHP Warning: phpinfo() [<a href='function.phpinfo'>function.phpinfo</a>]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for '-4.0/DST' instead in C:\inetpub\wwwroot\phpinfo.php on line 1
</Data>
<Data Name="ErrorCode">5</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>MODULE_WARNING</Opcode>
<Keywords>
<Keyword>Module</Keyword>
</Keywords>
<freb:Description Data="ErrorCode">Access is denied.
(0x5)</freb:Description>
From the top of the failed request log, I can see it's running under IUSR account:
tokenUserName="NT AUTHORITY\IUSR"
Here's settings for the fastCgi:
<fastCgi>
<application fullPath="C:\PHP\php-cgi.exe" instanceMaxRequests="10000">
<environmentVariables>
<environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
<environmentVariable name="PHPRC" value="C:\php\php.ini" />
</environmentVariables>
</application>
</fastCgi>
<handlers accessPolicy="Read, Script">
<add name="PHP via FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe" resourceType="Unspecified" requireAccess="Script" />
I've ensure that this user name has full control over my C:\PHP directory. My php.ini file is configured within C:\PHP directory.
In addition to following the directions in that article, I also tried to create a script map for PHP, and when I created that I got a difference error, not a 500.
HTTP Error 403.1 - Forbidden
You have attempted to run a CGI, ISAPI, or other executable program from a directory that does not allow executables to run.
Once again though, IUSR has full control over that directory so I don't quite understand why that error message.
Update
The issue was glaring right at me in the log. I had ignored the PHP Warning with regard to the date.timezone thinking that it's just a warning. I set it to:
date.timezone = America/New_York
and now it works.
For future reference you can use http://php.iis.net/ to easily install php into your IIS setup. It comes with a manager which will also let you go into 'development mode' which will display php errors as opposed to covering them up.