Laravel php artisan 模仿HTTPS
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26813316/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel php artisan serve to mimic HTTPS
提问by Jazzy
I have been searching around to see if there is a way I can mock SSL for local development using Laravel's artisan to serve HTTPS with no luck.
我一直在四处寻找,看看是否有一种方法可以使用 Laravel 的工匠为本地开发模拟 SSL,但没有运气。
Is this possible and if so, how?
这是可能的,如果是,如何?
I understand this is a very general question, but I am not seeing anything on this in searches.
我知道这是一个非常笼统的问题,但我在搜索中没有看到任何相关内容。
采纳答案by ?ван Худа
You can use ngrok
for that
您可以使用ngrok
该
php artisan serve
cd <path-to-ngrok>
./ngrok http localhost:8000
回答by kieranajp
Laravel uses the in-built PHP5.4 development server php -S
(http://php.net/manual/en/features.commandline.webserver.php) for it's artisan serve
command (see Illuminate\Foundation\Console\ServeCommand
). This only supports plain HTTP, so no, this isn't possible. Your best bet would be to use a Vagrant box set up to work with SSL/TLS.
Laravel 使用内置的 PHP5.4 开发服务器php -S
( http://php.net/manual/en/features.commandline.webserver.php) 作为它的artisan serve
命令(参见参考资料Illuminate\Foundation\Console\ServeCommand
)。这只支持普通的 HTTP,所以不,这是不可能的。您最好的选择是使用设置为使用 SSL/TLS 的 Vagrant 框。