logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache crashing with PHP7 when using SSL - status 3221226356
Author
oldbucsfan



Joined: 19 Aug 2016
Posts: 8

PostPosted: Fri 19 Aug '16 22:08    Post subject: Apache crashing with PHP7 when using SSL - status 3221226356 Reply with quote

Get this error when hitting https using PHP 7 and ApacheLounge binaries for Apache. Used abs.exe to test it and almost always get the error within 3 tests of 1000 requests. Usually get it in the first few hundred when hitting a wordpress site over SSL. Get it when all plugins are disabled. Get it hitting a website not using wordpress at all. Tried it with all extensions disabled except mysqli (needed to load the website). In other words, I can't seem to use Apache 2.4 with SSL and PHP 7. Tried basically totally simplifying the config files. Tried totally replacing the installs. The only thing that solves the error is using PHP 5. I've tried multiple versions of Apache 2.4 and PHP 7 to no avail. Any ideas?

abs.exe:
Quote:
SSL read failed (5) - closing connection
apr_pollset_add(): Not enough space (12)


error log:
Quote:
AH00428: Parent: child process 780 exited with status 3221226356 -- Restarting.


Backtrace:
Quote:
***********************
* EXCEPTION DETAILS *
***********************

DetailID = 1
Count: 2
Exception #: 0XC0000008
Stack:
ntdll!KiRaiseUserExceptionDispatcher+0x3a
KERNELBASE!CloseHandle+0x1b
libapr_1!apr_shm_size_get+0x27d
libapr_1!apr_shm_destroy+0x12
mod_socache_shmcb+0x161c
mod_ssl!ssl_run_proxy_post_handshake+0x8d12
mod_ssl!ssl_run_pre_handshake+0x3d97
libapr_1!apr_pool_clear+0x6e
httpd!OPENSSL_Applink+0xcef
httpd!OPENSSL_Applink+0x1f98
KERNEL32!BaseThreadInitThunk+0x22
ntdll!RtlUserThreadStart+0x34


Using Windows Server 2012 R2, Apache 2.4.23, PHP 7.0.10, MySQL 5.7.14.
Back to top
oldbucsfan



Joined: 19 Aug 2016
Posts: 8

PostPosted: Fri 19 Aug '16 23:18    Post subject: maybe related Reply with quote

Although this is for abs only, I wonder if it is related. Note that the error above happens often when not using abs.exe. abs is just triggering it on demand through the repeated requests.

https://www.apachelounge.com/viewtopic.php?p=33600
Quote:
So, how do I duplicate this to get the Applink error?

I have no problem adding the shim if needed but I have yet to see a need since mod_ssl never fails for me (or any of our users as far as I know).

EDIT: Or is this it?
Code:
Code:   
Benchmarking www.apachehaus.net (be patient)
Completed 100 requests
SSL read failed (5) - closing connection
apr_pollset_add(): Not enough space (12)
Total of 184 requests completed


This link notes that there was an issue related to OPENSSL_APPLINK with VC14 builds. I am using VC14 builds for PHP 7 and Apache. However, PHP 5 only comes in VC11, so I wonder if that is why it works and PHP 7 doesn't.

Just to check, I tried the same thing with the VC11 build of Apache 2.4.23 and it had the same problem when used with PHP 7.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sat 20 Aug '16 1:08    Post subject: Reply with quote

It's added now as part of the build as of 2.4.23 so this is why it doesn't fail. If it were an applink error abs would fail immediately before getting off a single request. So this is not the problem you're having. Sorry I do not know what is.

If it's happening with php, maybe there is where the problem is. PHP as a module or via mod_fcgid?
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1248
Location: Amsterdam, NL, EU

PostPosted: Tue 23 Aug '16 15:44    Post subject: Reply with quote

I saw the topic title and immediately thought: applink. OpenSSL VC14 without applink outputs things like 3221226356, even when you just run openssl.exe

Double check that abs, Apache and PHP7 are all using the same ssleay32.dll and libeay32.dll. Those in the apache\bin directory must be the same as those in the PHP7 directory if you are using PHP7 as a module. And even if you are using PHP7 as mod_fcgid, it is a good practice to use the same version for Apache and PHP. Both VC14 and both either x86 or x64.
Back to top
oldbucsfan



Joined: 19 Aug 2016
Posts: 8

PostPosted: Tue 23 Aug '16 15:57    Post subject: Reply with quote

glsmith wrote:
PHP as a module or via mod_fcgid?


I am using it as a module.
Back to top
oldbucsfan



Joined: 19 Aug 2016
Posts: 8

PostPosted: Tue 23 Aug '16 16:08    Post subject: Reply with quote

Jan-E wrote:
I saw the topic title and immediately thought: applink. OpenSSL VC14 without applink outputs things like 3221226356, even when you just run openssl.exe

Double check that abs, Apache and PHP7 are all using the same ssleay32.dll and libeay32.dll. Those in the apache\bin directory must be the same as those in the PHP7 directory if you are using PHP7 as a module. And even if you are using PHP7 as mod_fcgid, it is a good practice to use the same version for Apache and PHP. Both VC14 and both either x86 or x64.


Thanks! According to the backtrace, PHP is using the ones in the apache\bin directory. Just to make sure, I deleted the ones in the PHP directory and copied the ones from the apache\bin into the PHP directory. Error still occurs. It is rare, like 1 out of 3000 attempts sometimes.
Back to top
oldbucsfan



Joined: 19 Aug 2016
Posts: 8

PostPosted: Fri 09 Dec '16 1:38    Post subject: Same problem Reply with quote

Still have the same problem with PHP 7.0.14. It's not going away. Any ideas?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
Location: Germany, Next to Hamburg

PostPosted: Sat 10 Dec '16 12:54    Post subject: Reply with quote

oldbucsfan wrote:
glsmith wrote:
PHP as a module or via mod_fcgid?


I am using it as a module.


Run PHP over fcgid and that crashing will stop. Often that is caused by a faulty PHP extension.

To determine if PHP is the issue call a static page with abs.exe
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 1248
Location: Amsterdam, NL, EU

PostPosted: Wed 14 Dec '16 15:52    Post subject: Reply with quote

James Blond wrote:
Run PHP over fcgid and that crashing will stop. Often that is caused by a faulty PHP extension.

To determine if PHP is the issue call a static page with abs.exe

You could also try to disable the PHP-extensions one by one. @oldbucsfan: which PHP-extensions are you using?
Back to top
oldbucsfan



Joined: 19 Aug 2016
Posts: 8

PostPosted: Wed 11 Jan '17 21:20    Post subject: Reply with quote

Jan-E wrote:
James Blond wrote:
Run PHP over fcgid and that crashing will stop. Often that is caused by a faulty PHP extension.

To determine if PHP is the issue call a static page with abs.exe

You could also try to disable the PHP-extensions one by one. @oldbucsfan: which PHP-extensions are you using?


I have tried not loading extensions. The error happens regardless if I have extensions or not.

Same problem with PHP 7.1.0 and Apache 2.4.25.
Back to top
oldbucsfan



Joined: 19 Aug 2016
Posts: 8

PostPosted: Wed 11 Jan '17 21:40    Post subject: Reply with quote

This test script will cause an error after 1000s of tries via abs.exe, but will not cause the same error when attempted via ab.exe.

-----------------------
$wrappers = stream_get_wrappers();
print_r($wrappers);
$wrappers_re = '(' . join('|', $wrappers) . ')';
print($wrappers_re);
Back to top
oldbucsfan



Joined: 19 Aug 2016
Posts: 8

PostPosted: Thu 12 Jan '17 16:41    Post subject: Reply with quote

In other words, this appears to be an issue involving one of the extensions in Apache that handles the https protocol conflicting with PHP 7.
Back to top


Reply to topic   Topic: Apache crashing with PHP7 when using SSL - status 3221226356 View previous topic :: View next topic
Post new topic   Forum Index -> Apache