openSSL无法与PHP内置Web服务器一起使用
操作系统:Ubuntu 12.04 64位
OS: Ubuntu 12.04 64-bit
PHP版本:5.4.6-2〜precise + 1
PHP version: 5.4.6-2~precise+1
当我测试https页面时,我正在通过内置的网络服务器(php5- -S localhost:8000)进行写操作,Firefox(16.0.1)说问题加载:连接已中断",而终端告诉我":: 1:37026无效的请求(不支持的SSL请求)".
When I test an https page I am writing through the built-in webserver (php5 -S localhost:8000), Firefox (16.0.1) says "Problem loading: The connection was interrupted", while the terminal tells me "::1:37026 Invalid request (Unsupported SSL request)".
phpinfo()告诉我:
- 已注册的流套接字传输:tcp,udp,unix,udg,ssl,sslv3, tls
- [curl] SSL:是
- SSL版本:OpenSSL/1.0.1
-
openssl:
- Registered Stream Socket Transports: tcp, udp, unix, udg, ssl, sslv3, tls
- [curl] SSL: Yes
- SSL Version: OpenSSL/1.0.1
openssl:
OpenSSL支持:已启用
OpenSSL support: enabled
OpenSSL库版本OpenSSL 1.0.1 2012年3月14日
OpenSSL Library Version OpenSSL 1.0.1 14 Mar 2012
OpenSSL标头版本OpenSSL 1.0.1 2012年3月14日
OpenSSL Header Version OpenSSL 1.0.1 14 Mar 2012
是的,http页面可以正常工作.
Yes, http pages work just fine.
有什么想法吗?
请参阅内置Web服务器shim上的手册部分:
http://php.net/manual/en/features.commandline.webserver.php
See the manual section on the built-in webserver shim:
http://php.net/manual/en/features.commandline.webserver.php
它不支持SSL加密.它用于纯HTTP请求. openssl
扩展名和功能支持无关.它不接受请求或通过流包装发送响应.
It doesn't support SSL encryption. It's for plain HTTP requests. The openssl
extension and function support is unrelated. It does not accept requests or send responses over the stream wrappers.
如果您希望SSL在其上运行,请尝试使用stunnel
包装器:
If you want SSL to run over it, try a stunnel
wrapper:
php -S localhost:8000 &
stunnel3 -d 443 -r 8080
这只是为了玩弄.