问题描述
操作系统: 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
当我通过内置网络服务器 (php5 -S localhost:8000) 测试 https 页面时,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.
有什么想法吗?
推荐答案
请参阅有关内置网络服务器 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  
反正只是用来玩玩的.
这篇关于openSSL 不适用于 PHP 内置网络服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!



大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)