Edit report at https://bugs.php.net/bug.php?id=55470&edit=1
ID: 55470
User updated by: douglas dot wright at pre-school dot org dot uk
Reported by: douglas dot wright at pre-school dot org dot uk
Summary: Crash when calling openssl_sign under mod_php
Status: Open
Type: Bug
Package: Apache2 related
Operating System: Windows Server 2008/Windows 7
PHP Version: 5.3.7
Block user comment: N
Private report: N
New Comment:
Having tested, I confirm that overwriting the Apache version of those two SSL
files with PHP's stops the crash.
However as I do use HTTPS, it's not a fix I can put into production.
Surely PHP should be using it's own copy of openssl?
Previous Comments:
------------------------------------------------------------------------
[2011-08-30 08:10:26] ska-pig at gmx dot net
The problem is probably a wrong opensll library version. When PHP runs as an
apache module it will use libeay32.dll and ssleay32.dll from the apache\bin
directory rather than the ones in your php installation folder. Apache from
apachelounge is built with openssl 1.0.0d but PHP with openssl 0.9.8r. Copying
libeay32.dll and ssleay32.dll from the PHP folder to your apache bin directory
will likely solve the problem, although this might cause problems with apache
if you use SSL with apache as well.
------------------------------------------------------------------------
[2011-08-21 00:26:12] douglas dot wright at pre-school dot org dot uk
Description:
------------
Attempting to use openssl_sign() when running under mod_php causes a crash.
The test script works without problem when run from the command line.
Tested with the Apache Lounge build of Apache 2.2.19 (latest)
Test script:
---------------
<?php
//non-confidential test key
$key = <<<ENDKEY
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAxAa4FfgtluQBKZvSx5syCvM0i9AKyWk++zCPjK8dInGxd2SE
jn6p+OKLzhu0rZfIKolsy8oIbyrCD+6Itc2jT7pFdrErlPhm4KzMhcqoPxuPiLTe
fz9KfCYdzw/AR9Me685Iw2ehFzpPJ80n+YqeESttzyCEmT2usRz1jzECv6XrRDSj
bpJ5rYo+nxLCC40M1Bv5dulKaHixvmF5LuUhLGr9TQcNmJl4WMdLKBt8ytu+HxoU
k72c1mqwhga6K0gR4u3ZJ2qCf0CvhZHpv/3NPnHrxE729kV3UADun/ZlvHL0eSro
vjXsdGyHzs6cKlWEBVpttBpYusvbCq2Kga/ADQIDA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ExVEEpx3vb400St9JMN
ZtFwwmOpcuYN6F2hmdr9EaxBBqCvbF+eBucj3MWYtaaI1bT4WtfveJYzz28CpNp3
/HvIuBnyZHHkGiXGcYKR06oxHsLOSzbeztTNw+NMuAowlBLdENjX
-----END RSA PRIVATE KEY-----
ENDKEY;
openssl_sign('foo', $signature, $key);
echo base64_encode($signature);
Expected result:
----------------
Running the test script should output 1-2 lines of base64.
Actual result:
--------------
Apache process terminates, no output is sent to browser.
The Apache error log contains the message: "Parent: child process exited with
status 255 -- Restarting."
PHP's error log says nothing.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55470&edit=1