Bug #71645 [Fbk->Csd]: PHP7.0.3. OpenSSL Fatal error.
Edit report at https://bugs.php.net/bug.php?id=71645&edit=1
ID: 71645
Updated by: yohgaki@php.net
Reported by: bupy765 at gmail dot com
Summary: PHP7.0.3. OpenSSL Fatal error.
-Status: Feedback
+Status: Closed
Type: Bug
Package: OpenSSL related
Operating System: OSX 10.9.5
PHP Version: 7.0.3
-Assigned To:
+Assigned To: yohgaki
Block user comment: N
Private report: N
New Comment:
Reporter confirms it's working now. Thanks for reporting back.
Previous Comments:
------------------------------------------------------------------------
[2016-02-22 20:32:54] bupy765 at gmail dot com
Thanks, yohgaki! I rebuild PHP7 with new OpenSSL:
$ php -i | grep -i openssl
openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.0.2f 28 Jan 2016
OpenSSL Header Version => OpenSSL 1.0.2f 28 Jan 2016
Openssl default config => /usr/local/etc/openssl/openssl.cnf
openssl.cafile => no value => no value
openssl.capath => no value => no value
OpenSSL support => enabled
All work! Thanks!
------------------------------------------------------------------------
[2016-02-22 18:48:01] yohgaki@php.net
OpenSSL Library Version => OpenSSL 0.9.8zg 14 July 2015
OpenSSL Header Version => OpenSSL 1.0.1j 15 Oct 2014
You have multiple openssl versions installed in your system and using wrong openssl library.
Link with 1.0.1j and see if it works. (e.g. Remove old openssl)
[yohgaki@dev php-build]$ php -v
PHP 7.0.3 (cli) (built: Feb 23 2016 03:31:55) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.0RC4, Copyright (c) 2002-2016, by Derick Rethans
[yohgaki@dev php-build]$ php -ddisplay_errors=1 -derror_reporting=-1 -r
'var_dump(openssl_x509_parse(file_get_contents("https://raw.githubusercontent.com/composer/composer/master/res/cacert.pem")));'
**SNIP worked well**
[yohgaki@dev php-build]$ rpm -q openssl
openssl-1.0.2f-1.fc23.x86_64
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.0.2f-fips 28 Jan 2016
OpenSSL Header Version => OpenSSL 1.0.2f-fips 28 Jan 2016
Openssl default config => /etc/pki/tls/openssl.cnf
------------------------------------------------------------------------
[2016-02-22 15:33:43] RQuadling at GMail dot com
Interestingly, that value translates to 0x8000 0000 0000 0068. Maybe this is a signed/unsigned issue
of some sort?
------------------------------------------------------------------------
[2016-02-22 15:26:44] bupy765 at gmail dot com
Sorry! Expected result it is Actual result.
------------------------------------------------------------------------
[2016-02-22 15:22:18] bupy765 at gmail dot com
Description:
------------
I have build PHP7 using following source: ttps://secure.php.net/downloads.php#v7.0.3
I got error associated with OpenSSL when used Composer. Initially I thought that it Composer bug and
sent report to Composer team: https://github.com/composer/composer/issues/4940
Together with team of Composer came to the conclusion that it bug PHP7.
Information about PHP7, OpenSSL and OS:
OS X 10.9.5
---
PHP 7.0.3 (cli) (built: Feb 22 2016 19:34:44) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.0RC4, Copyright (c) 2002-2016, by Derick Rethans
---
/Volumes/Home/username/.phpbrew/php/php-7.0.3/var/db/openssl.ini,
openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 0.9.8zg 14 July 2015
OpenSSL Header Version => OpenSSL 1.0.1j 15 Oct 2014
Openssl default config => /System/Library/OpenSSL/openssl.cnf
openssl.cafile => no value => no value
openssl.capath => no value => no value
OpenSSL support => enabled
Test script:
---------------
php -ddisplay_errors=1 -derror_reporting=-1 -r 'openssl_x509_parse(file_get_contents("https://raw.githubusercontent.com/composer/composer/master/res/cacert.pem"));'
Expected result:
----------------
PHP Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate
9223372036854775912 bytes) in Command line code on line 1
PHP Stack trace:
PHP 1. {main}() Command line code:0
PHP 2. openssl_x509_parse() Command line code:1
Fatal error: Allowed memory size of 2147483648 bytes exhausted (tried to allocate
9223372036854775912 bytes) in Command line code on line 1
Call Stack:
0.0001 349360 1. {main}() Command line code:0
1.8493 610256 2. openssl_x509_parse() Command line code:1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71645&edit=1
Thread (6 messages)