Laravel php artisan serve to mimic HTTPS

廉价感情. 提交于 2019-12-12 10:36:08

问题


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.

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.


回答1:


You can use ngrok for that

php artisan serve
cd <path-to-ngrok>
./ngrok http localhost:8000

https://ngrok.com/




回答2:


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.



来源:https://stackoverflow.com/questions/26813316/laravel-php-artisan-serve-to-mimic-https

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!