php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38982 No SSL-socket functions in CLI
Submitted: 2006-09-28 13:16 UTC Modified: 2006-10-06 01:00 UTC
Votes:5
Avg. Score:4.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:3 (75.0%)
From: admin at denic-294 dot de Assigned:
Status: No Feedback Package: OpenSSL related
PHP Version: 4.4.4 OS: Debian different releases
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: admin at denic-294 dot de
New email:
PHP Version: OS:

 

 [2006-09-28 13:16 UTC] admin at denic-294 dot de
Description:
------------
As in Bug #26612 i was getting the error: "no SSL support in this build" while trying to "fsockopen("ssl://...",xxx);". I am using the CLI-version of php-4.4.4. 

Just as in the other bug "phpinfo();" showed active OpsnSSL support, so after trying many diffrent configure options i finally tried the include of "php_config.h" in "php.h" and it worked for this bug too.

greetz
Chris


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-28 13:28 UTC] tony2001@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.



 [2006-09-28 13:57 UTC] admin at denic-294 dot de
Ok following the how-to-report:

What i did: $fd=fsockopen("ssl://...",xxx);

What i wanted to happen: get a $fd with an active SSL connection to the given host.

What actually happened: i got the error-message "no SSL support in this build".

I searched the bug-database and found the but i related to. The tip with the include of "php_config.h" in "php.h" worked to get it running.

In the end i just wanted to let you know of the bug that (for the cli-version) is still there in the latest php4-release. So you can close this if open means that i still need help. 

greetz Chris
 [2006-09-28 14:08 UTC] tony2001@php.net
Works perfectly fine. 
And we don't support any unofficial binary builds, so please report it to maintainers of your .deb package.
 [2006-09-28 14:20 UTC] admin at denic-294 dot de
1. I did NOT use any binary build. i downloaded the source.tar.gz from php.net and compiled it myself (why else would i speak about configure options or adding an include-line to the sourcecode???) !

2. It works perfectly fine with the apache module. I do not know if it works with the CGI-version. But it definatly does NOT work on the CLI-version !

So do NOT set my report to bogus. If you dont want any help just tell me and ill never report anything ever again.
 [2006-09-28 14:31 UTC] tony2001@php.net
ssl://, ftps:// and https:// work here in CLI with just --with-openssl and without any patches.
I asked you for additional information, I didn't ask you to repeat the same as in your first message.
 [2006-09-28 14:59 UTC] admin at denic-294 dot de
The php-source:
---------------
1: #!/root/php-4.4.4/sapi/cli/php
2: <?php
[...]
67: $fp=fsockopen("ssl://".$host,$port,$errno,$errstr);
[...]

The result:
-----------
Warning: fsockopen(): no SSL support in this build in /home/.../script.php on line 67

Warning: fsockopen(): unable to connect to xxxx.xxxx:12345 in /home/.../script.php on line 67

The configure-command:
----------------------
./configure --disable-cgi --with-mysql --with-openssl
(It worked with the same command after the patch)

I tried compiling with debian woody and debian sarge on different servers which did not affect the result in any way.

Is there any more information that would help you ?
 [2006-09-28 15:10 UTC] iliaa@php.net
Does php -m show the ssl extension as being loaded?
 [2006-09-28 15:28 UTC] tony2001@php.net
Please try to configure it with just ./configure --disable-all --with-openssl.
 [2006-10-06 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".
 [2007-02-15 04:00 UTC] mi7892 at hotmail dot com
I got the same problem too, i compile php-4.4.4 with following command:

./configure --prefix=/usr/local/php4 --with-config-file-path=/usr/local/php4 --with-mysql=/usr/local/mysql --with-openssl=/usr/local/ssl --with-apxs2=/usr/local/apache2/bin/apxs --disable-all

and run the following php in cli.

<?php
$a = file_get_contents('https://www.interwetten.com');
?>

I got the following result:

[root@www2 bin]# ./php ~/a.php

Warning: file_get_contents(): php_stream_sock_ssl_activate_with_method: failed to create an SSL context in /root/a.php on line 3

Warning: file_get_contents(https://www.interwetten.com): failed to open stream: Unable to activate SSL mode in /root/a.php on line 3


here is the result from php -m

[root@myserver bin]# ./php -m
[PHP Modules]
mysql
openssl
standard

[Zend Modules]
 [2007-02-23 15:29 UTC] xawiers at gmail dot com
System => FreeBSD 6.1-RELEASE-p12
Build Date => Feb 23 2007 17:11:29
Configure Command =>  './configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--disa
ble-all' '--program-prefix=' '--enable-force-cgi-redirect' '--enable-discard-path' '--enable-fastcgi' '--with-regex=php' '--with-openssl=/usr/local' '--with-o
penssl-dir=/usr/local' '--with-zlib=/usr' '--enable-zend-multibyte' '--disable-ipv6' '--prefix=/usr/local'
Server API => Command Line Interface

Registered PHP Streams => php, http, ftp, https, ftps, compress.zlib

[PHP Modules]
openssl
standard
zlib

WHERE IS SSL TLS stream ???
 [2007-04-05 15:17 UTC] peter dot arien at cc dot kuleuven dot be
Same problem with PHP 4.4.6

config:
./configure \
  --with-config-file-path=/usr/local/etc \
  --disable-safe-mode \
  --enable-track-vars \
  --enable-ftp \
  --disable-debug \
  --with-mysql=/usr/local/mysql50 \
  --with-dom \
  --with-gdbm \
  --with-zlib \
  --with-iconv=/usr/local \
  --with-snmp \
  --with-gd \
  --with-curl \
  --with-openssl \
  --enable-xslt \
  --with-xslt-sablot \
  --with-freetype-dir=/usr \
  --with-mcrypt \
  --with-oracle=/oracle/product/8.1.7 \
  --with-ldap

# ldd /usr/local/bin/php|grep ssl
  libssl.so.0.9.7 => /usr/lib/i686/cmov/libssl.so.0.9.7 (0x4d34e000)

# php -i|grep -i ssl
Configure Command =>  './configure' '--with-config-file-path=/usr/local/etc' '--disable-safe-mode' '--enable-track-vars' '--enable-ftp' '--disable-debug' '--with-mysql=/usr/local/mysql50' '--with-gdbm' '--with-iconv=/usr/local' '--with-dom' '--with-zlib' '--with-snmp' '--with-gd' '--with-curl' '--enable-xslt' '--with-xslt-sablot' '--with-openssl' '--with-freetype-dir=/usr' '--with-mcrypt' '--with-oracle=/oracle/product/8.1.7' '--with-ldap'
CURL Information => libcurl/7.13.2 OpenSSL/0.9.7e zlib/1.2.3 libidn/0.5.13
openssl
OpenSSL support => enabled
OpenSSL Version => OpenSSL 0.9.7e 25 Oct 2004

Testscript: test.php

<?php
$fp = fsockopen("ssl://www.entropy.ch", 443, $errno, $errstr, 10);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    $out = "GET /home/ HTTP/1.1\r\n";
    $out .= "Host: www.entropy.ch\r\n";
    $out .= "Connection: Close\r\n\r\n";
    fwrite($fp, $out);
    while (!feof($fp)) {
        echo fgets($fp, 128);
    }
    fclose($fp);
}
?>

Result:

# php test.php

Warning: fsockopen(): no SSL support in this build in /tmp/test.php on line 3
Warning: fsockopen(): unable to connect to www.entropy.ch:443 in /tmp/test.php on line 3
Success (0)<br />

This test-script does work with the apache-module version of PHP on the same server with the same (except for the specific CLI config entries) config.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 09 07:01:27 2024 UTC