یلدا ادامه داره... ❤️ ۴۰ درصد تخفیف همه دوره‌ها

استفاده از تخفیف‌ها
ثانیه
دقیقه
ساعت
روز
Saied Hr
5 سال پیش توسط Saied Hr مطرح شد
1 پاسخ

خطا هنگام اجرای php artisan serve

سلام دوستان من هنگام اجرای دستور Php artisan serve با این مشکل مواجه میشم.لطفا راهنمایی کنید.

[*** Feb  1 14:50:57 2020] 127.0.0.1:2126 Invalid request (Unsupported SSL request)

ثبت پرسش جدید
coarad supp
تخصص : برنامه نویس لاراول
@coaradsupp 5 سال پیش مطرح شد
0

I solved this later, just in case anyone has a similar problem in the future, I discovered the AppServiceProvider class had a register method where a security interception middleware was registered to force every http request to https. so what I did was write an if-else logic to allow this only on production since my localhost had no ssl certificate.

in app/providers/AppServiceProvider.php

look for the register() method, the implement the logic by checking tha app is local or not. The isLocal() function checks your .env file for APP_ENV variable and returns true if is local, so you reconfirm again that that is set to local and be sure to clear any previous configuration cache.

            //check that app is local
       if ($this->app->isLocal()) {
              //if local register your services you require for development
            $this->app->register('Barryvdh\Debugbar\ServiceProvider');
        }else{
              //else register your services you require for production
            $this->app['request']->server->set('HTTPS', true);
        }

https://stackoverflow.com/questions/57617864/how-to-fix-invalid-request-unsupported-ssl-request


برای ارسال پاسخ لازم است وارد شده یا ثبت‌نام کنید

ورود یا ثبت‌نام