Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

BarbaraSM's avatar

Use https://localhost:8000 to start server

Hi guys!! I am developing my Laravel project with xampp in my local computer, and I would want to start my server with https, may I? Thank so much

0 likes
14 replies
BarbaraSM's avatar

I'm sorry but I can't do it. I have in a different folder my Laravel project and xampp server, how can I do it?

ENGEL's avatar

@BarbaraSM Just do it this:

<VirtualHost 127.0.0.2:443>
    DocumentRoot "C:/xampp/htdocs/myproject/web" <-- Put here your laravel path
    ServerName myproject
    SSLEngine on
    SSLCertificateFile "conf/ssl.crt/server.crt"
    SSLCertificateKeyFile "conf/ssl.key/server.key"
    <Directory "C:/xampp/htdocs/myproject/web"> <-- Put here your laravel path
        Options All
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>
1 like
BarbaraSM's avatar

@ENGEL I get this error: 127.0.0.1:50646 Invalid request Unsupported SSL request do you have any idea? Thank!

Snapey's avatar

There should be no difference in behaviour between http and https so for the purposes of development it should not matter.

If you think that you must have https locally to test something then you may be approaching things wrong.

I have several sites in production on https but all developed locally on http - there is no allowance made within the project.

2 likes
juanclb's avatar

@Snapey I have to test an API that only works on SSL so I must have SSL locally.

isharad22's avatar

I have same problem on integrating the facebook login/signup api, when I run php artisan serve, and after that when I register through facebook,My Chrome Browser blocks it with a message "localhost unexpectedly closed the connection." And at Command line I got this message "Invalid request (Unsupported SSL request)" plzzz help

connecteev's avatar

Same problem here. FB login requires https on localhost. What a pain. Anyone know how to enable this on localhost / php artisan?

jlrdw's avatar

Set up a good development server. Not the included one in PHP.

abolhasan's avatar

I sloved it , As you know: there is no way run https on Laravel development server.

if you work on fb sdk api and need ssl,just go on " facebook app login setting" and set" Valid OAuth Redirect URIs" like this: http://localhost:8000/. if use "localhost" insted"127.0.0.1", facebook accept this way and you don't need to use https,so no need ssl. good luck

1 like

Please or to participate in this conversation.