php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44353 https loads in apache, fails on cli. http fine
Submitted: 2008-03-06 18:03 UTC Modified: 2008-03-25 01:00 UTC
Votes:4
Avg. Score:4.0 ± 1.0
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jmatthies at townleyandassociates dot com Assigned:
Status: No Feedback Package: CGI/CLI related
PHP Version: 5.2.5 OS: hp/ux 11.11
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jmatthies at townleyandassociates dot com
New email:
PHP Version: OS:

 

 [2008-03-06 18:03 UTC] jmatthies at townleyandassociates dot com
Description:
------------
simple php file:

<?echo  file_get_contents('https://www.google.co.uk/ig?hl=en'); ?>

works fine when loaded in apache 2.0.58. When i run it via the cli, I get:

Warning: file_get_contents(): SSL: No such file or directory in <file>
Warning: file_get_contents(): Failed to enable crypto in <file>

If I change it to http://, it works in apache and the cli

Configure Command =>  './configure'  '--prefix=/opt/hpws/apache/php' '--enable-soap' '--with-libxml-dir=/usr/local' '--with-openssl=/usr/local' '--with-openssl-dir=/usr/local' '--enable-ipv6' '--with-apxs2=/opt/hpws/apache/bin/apxs' 
'--with -unixODBC=shared,/opt/unixODBC'

php -m shows the openssl module loaded. php -i shows similar output to phpinfo() through apache in regards to openssl info.


Reproduce code:
---------------
<?echo  file_get_contents('https://www.google.co.uk/ig?hl=en'); ?>

Expected result:
----------------
load the web page in question

Actual result:
--------------
Warning: file_get_contents(): SSL: No such file or directory in /opt/hpws/apache /htdocs/t.php on line 2
Warning: file_get_contents(): Failed to enable crypto in /opt/hpws/apache/htdocs /t.php on line 2
Warning: file_get_contents(https://www.google.co.uk/ig?hl=en): failed to open stream: Invalid argument in /opt/hpws/apache/htdocs/t.php on line 2


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-13 12:18 UTC] jani@php.net
Works fine for me. Try running the CLI binary without loading any php.ini:

# php -n test.php

 [2008-03-14 20:32 UTC] jmatthies at townleyandassociates dot com
p -n <file> gives identical results:

Warning: file_get_contents(): SSL: No such file or directory in /opt/hpws/apache /htdocs/t.php on line 2
Warning: file_get_contents(): Failed to enable crypto in /opt/hpws/apache/htdocs /t.php on line 2
Warning: file_get_contents(https://www.google.co.uk/ig?hl=en): failed to open st ream: No such file or directory in /opt/hpws/apache/htdocs/t.php on line 2
 [2008-03-17 20:56 UTC] jani@php.net
And you're 100% sure that the installed CLI binary and Apache module are from same build? (check the installed modules in both!)
 [2008-03-25 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-07-01 14:31 UTC] seklecki at noc dot cfi dot pgh dot pa dot us
We're seeing this problem too:

- FreeBSD/amd64 6.3-P10
- php5-5.2.9
-  OpenSSL 0.9.7e-p1 25 Oct 2004
 [2012-10-19 08:38 UTC] rtoelhoej at mcg-systems dot dk
We're seeing this problem too:

System => Windows NT VM-APM2011-AGEN 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586
PHP Version => 5.3.8
OpenSSL Library Version => OpenSSL 0.9.8r 8 Feb 2011

Registered PHP Streams => php, file, glob, data, http, ftp, zip, compress.zlib, https, ftps, phar  
Registered Stream Socket Transports => tcp, udp, ssl, sslv3, sslv2, tls
 [2012-10-19 09:33 UTC] rtoelhoej at mcg-systems dot dk
Solution found :)

It is because the target server is running OpenSSL 1.0 and PHP are using OpenSSL 0.9, they can't talk properly together.

My workaround was to downgrade Apache to OpenSSL 0.9.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 11 09:01:28 2024 UTC