我一直在尝试在 PHP 中启用 HTTPS/SSL (443) 流,但完全没有成功。我的证书已正确安装,并且我通常可以使用 HTTPS 浏览网站,但 phpinfo() 表示此类流尚未安装,至少对于 PHP 而言。
这是我在使用 php 时遇到的实际错误:
ssl://gateway.sandbox.push.apple.com:2195... Thu, 14 Mar 2013 19:44:40 +0100 ApnsPHP3893: ERROR: Unable to connect to 'ssl://gateway.sandbox.push.apple.com:2195': Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
我在用着:
- 来自亚马逊的 64 位 SUSE Linux AMI
- Apache 2.2.12
- PHP 5.2.14
- MySQL 运行良好
Phpinfo() 告诉我:
additional .ini files parsed: /etc/php5/conf.d/ctype.ini, /etc/php5/conf.d/curl.ini, /etc/php5/conf.d/dom.ini, /etc/php5/conf.d/gd.ini, /etc/php5/conf.d/hash.ini, /etc/php5/conf.d/iconv.ini, /etc/php5/conf.d/json.ini, /etc/php5/conf.d/mbstring.ini, /etc/php5/conf.d/mysql.ini, /etc/php5/conf.d/mysqli.ini, /etc/php5/conf.d/openssl.ini, /etc/php5/conf.d/pcntl.ini, /etc/php5/conf.d/pdo.ini, /etc/php5/conf.d/pdo_mysql.ini, /etc/php5/conf.d/pdo_sqlite.ini, /etc/php5/conf.d/soap.ini, /etc/php5/conf.d/sqlite.ini, /etc/php5/conf.d/suhosin.ini, /etc/php5/conf.d/tokenizer.ini, /etc/php5/conf.d/xmlreader.ini, /etc/php5/conf.d/xmlwriter.ini, /etc/php5/conf.d/zip.ini
Registered PHP Streams: php, file, data, http, ftp
Registered Stream Socket Transports: tcp, udp, unix, udg
cURL support enabled
cURL Information libcurl/7.19.0 OpenSSL/0.9.8j zlib/1.2.3 libidn/1.10
Mod_ssl 也显示在已加载的模块部分下,并且 extension=openssl.so 也在 php.ini 中正确设置。
有人让我尝试php -i | grep 'Configure Command'
,结果出现以下错误:
php: error while loading shared libraries: libmm.so.14: cannot open shared object file: No such file or directory
答案1
从 PHP 4.3.0 开始,HTTP 流包含 HTTPS,它不是一个单独的流phpinfo()
。http://www.php.net/manual/en/wrappers.http.php