Apache keeps on crashing
Posted by: Jos_Geerts (165.225.12.---)
Date: February 04, 2025 02:00PM

Hi,

I installed the latest version of Wampserver on to a newly deployed Windows 2019 server (Amazon) including all runtime packages (also downloaded from wampserver) but when I try to run some scripts (php), Apache httpd service is crashing with this error:

Faulting application name: httpd.exe, version: 2.4.62.0, time stamp: 0x66d81b2d
Faulting module name: VCRUNTIME140.dll, version: 14.42.34433.0, time stamp: 0x98c03cc5
Exception code: 0xc0000005
Fault offset: 0x0000000000011504
Faulting process id: 0xd48
Faulting application start time: 0x01db76ef31fd56d7
Faulting application path: D:\wamp64\bin\apache\apache2.4.62.1\bin\httpd.exe
Faulting module path: C:\Windows\SYSTEM32\VCRUNTIME140.dll
Report Id: e043a631-70b1-4471-a899-9d308404de85
Faulting package full name:
Faulting package-relative application ID:

It's crashing a bit randomly, it does not matter which php scripts I run, sometimes it runs fine (50%), but it fails many times.

I also did the same installation on a Windows 2022 server (also on Amazon), but I get the same error.

Any idea what's causing this ...?

Thanks,
Jos.

Options: ReplyQuote
Re: Apache keeps on crashing
Posted by: Otomatic (Moderator)
Date: February 04, 2025 02:15PM

Hi,

- Go to VisualCppRedist AIO All Releases
Download the latest version of VisualCppRedist_AIO_x86_x64.exe and run it as administrator. All necessary redistributable VC++ files will be installed and any excess or obsolete files will be removed. To ensure that everything runs smoothly, you'll need to disable certain applications when prompted to do so by the VC++ Redist installer.

You can upgrade to Apache 2.4.63.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Apache keeps on crashing
Posted by: Jos_Geerts (165.225.12.---)
Date: February 04, 2025 02:30PM

Hi,
Thanks for your response.
But that's what I did to install the runtime libraries. I downloaded VisualCppRedist_AIO_X86_x64.exe and executed it as Administrator. Apache started crashing .... I went to the Microsoft download site and I even downloaded and installed a more recent version but that one did not resolve the issue either, Apache is still crashing.

Options: ReplyQuote
Re: Apache keeps on crashing
Posted by: Jos_Geerts (165.225.12.---)
Date: February 04, 2025 02:42PM

I just downloaded the latest one and ran it with Administrator privileges, but that doesn't help, Apache still crashing with same error.

Options: ReplyQuote
Re: Apache keeps on crashing
Posted by: Otomatic (Moderator)
Date: February 04, 2025 02:57PM

> Windows 2019 server (Amazon)
> Windows 2022 server (also on Amazon)

What does "Amazon" mean? Because that's what all the crashes have in common!

Check the Apache and PHP log files to see if there might be a more explanatory error label.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Apache keeps on crashing
Posted by: Jos_Geerts (165.225.12.---)
Date: February 04, 2025 03:07PM

AWS = Amazon Web Services, it's a cloud host provider.
See: [aws.amazon.com]

Options: ReplyQuote
Re: Apache keeps on crashing
Posted by: Otomatic (Moderator)
Date: February 04, 2025 04:30PM

Wampserver is designed to run locally, not in the cloud!

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Apache keeps on crashing
Posted by: Jos_Geerts (165.225.13.---)
Date: February 05, 2025 11:39AM

I don't think that it really matters....
it's a (virtual) server on a hosting provider.
But it's ok, if you don't know what's causing Wampserver to crash ...

Options: ReplyQuote
Re: Apache keeps on crashing
Posted by: Otomatic (Moderator)
Date: February 05, 2025 03:33PM

In httpd.conf, you can try increasing the :
- ThreadStackSize normally to 8388608 bytes (8M)
Please note that the value must be given in bytes.

- ThreadPerChild whose default value, under Windows, is 64
Note that the value of ThreadPerChild is limited to that of ThreadLimit, which defaults to 1920.

ThreadPerChild and ThreadLimit are not included in Apache 2.4.62 but are present in Apache 2.4.63, but you can add these two directives - if not already present - just after ThreadStackSize.

See Apache Documentation

See also VCRUNTIME140.DLL crash

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 02/05/2025 03:39PM by Otomatic.

Options: ReplyQuote
Re: Apache keeps on crashing
Posted by: Jos_Geerts (165.225.12.---)
Date: February 13, 2025 11:19AM

I finally found the root cause :-)
it's an incomplete definition in http.conf that is causing this.
Make sure it's complete and looks like this:

LoadModule fcgid_module modules/mod_fcgid.so
<IfModule fcgid_module>
FcgidMaxProcessesPerClass 300
FcgidConnectTimeout 10
FcgidProcessLifeTime 0
FcgidMaxRequestsPerProcess 0
FcgidMinProcessesPerClass 0
FcgidFixPathinfo 0
FcgidZombieScanInterval 20
FcgidMaxRequestLen 536870912
FcgidIOTimeout 120
FcgidTimeScore 3
FcgidPassHeader Authorization
Define PHPROOT ${INSTALL_DIR}/bin/php/php
Define FCGIPHPVERSION 8.1.31
FcgidInitialEnv PHPRC \${PHPROOT}\${FCGIPHPVERSION}
<Files ~ "\.php$">
Options +Indexes +Includes +FollowSymLinks +MultiViews +ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "\${PHPROOT}\${FCGIPHPVERSION}/php-cgi.exe" .php
</Files>
</IfModule>

The section starting with "Define FCGIPHPVERSION ..." (make sure to add the correct PHP version here) needs to be in there. If not, it'll cause Apache to crash randomly with the message that you see in post 1.

Sharing it here in case someone else would have the same issue on Windows Server 2019 or 2022.

Thanks Otomatic, I know it's not always easy to help out on the many different setups that are used everywhere so, I do appreciate that there's someone like you still trying to help out.

Options: ReplyQuote
Re: Apache keeps on crashing
Posted by: Otomatic (Moderator)
Date: February 13, 2025 02:59PM

Hi,

By doing this, you force PHP 8.1.31 FCGI mode on all local sites (VirtualHost) and all aliases that aren't already in FCGI mode, and this makes a "merry mess", as we say in my house, of everything that was running with PHP as an Apache module.

For example, the localhost page running under Apache module PHP 8.4.4 ends up under PHP 8.1.31 (phpinfo) with a php.ini with errors like :
*** ERROR *** The PHP configuration loaded file is: e:/wamp64/bin/php/php8.1.31/php.ini - should be: E:/wamp64/bin/apache/apache2.4.63.1/bin/php.ini or e:/wamp64/bin/php/php8.4.4/phpforapache.ini

and PHP errors
[13-Feb-2025 13:52:32 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'ldap' (tried: E:/wamp64/bin/php/php8.1.31/ext/ldap (The specified module cannot be found), E:/wamp64/bin/php/php8.1.31/ext/php_ldap.dll (The specified module cannot be found)) in Unknown on line 0
[13-Feb-2025 13:52:32 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: E:/wamp64/bin/php/php8.1.31/ext/curl (The specified module cannot be found), E:/wamp64/bin/php/php8.1.31/ext/php_curl.dll (The specified module cannot be found)) in Unknown on line 0
[13-Feb-2025 13:52:32 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'com_dotnet' (tried: E:/wamp64/bin/php/php8.1.31/ext/com_dotnet (The specified module cannot be found), E:/wamp64/bin/php/php8.1.31/ext/php_com_dotnet.dll (The specified procedure cannot be found)) in Unknown on line 0
[13-Feb-2025 13:52:32 UTC] PHP Warning: PHP Startup: fileinfo: Unable to initialize module
Module compiled with module API=20210902
PHP compiled with module API=20240924
These options need to match

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons



Edited 1 time(s). Last edit at 02/13/2025 05:43PM by Otomatic.

Options: ReplyQuote
Re: Apache keeps on crashing
Posted by: Jos_Geerts (165.225.12.---)
Date: February 14, 2025 08:06AM

That's indeed true :-), but I;m not using PHP 8.4.4, I'm only using 8.1.31.

Options: ReplyQuote


Sorry, only registered users may post in this forum.