Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel php artisan serve to mimic HTTPS

Tags:

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.

like image 448
Jazzy Avatar asked Nov 08 '14 03:11

Jazzy


2 Answers

You can use ngrok for that

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

https://ngrok.com/

like image 188
Іван Худа Avatar answered Sep 23 '22 04:09

Іван Худа


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.

like image 23
kieranajp Avatar answered Sep 26 '22 04:09

kieranajp