mojahed
mojahed

Reputation: 289

127.0.0.1:8000 keeps on loading in a laravel project

I have a laravel project but when I use the command "php artisan serve" and type the url: http://127.0.0.1:8000/ , its just keep on loading without output nor error appear.

Upvotes: 6

Views: 28784

Answers (11)

Daniel_Ranjbar
Daniel_Ranjbar

Reputation: 120

In my case, MySQL was running fine. unless it wasn't. It was showing that it was running okay, but it wasn't. Cause when restarting the Xampp MySQL server. It stated that MySQL couldn't start due to a blocked port or... I then renamed Xampp/mysql/data to Xampp/mysql/data_old created a new folder named data there and copied everything from Xampp/mysql/backup to Xampp/mysql/data. then restarted the Xampp MySQL server,

my laravel project also finished loading and served the application. so the problem was with mysql server not starting properly.

Upvotes: 0

Nazmul Hoque
Nazmul Hoque

Reputation: 970

If you are using xampp

just restart Apache and MySql

Upvotes: 2

Tejas
Tejas

Reputation: 48

In my case I uninstalled Xampp and reinstalled it(I'm assuming you are using Xampp too).It worked for me.

Upvotes: 0

JonattanD
JonattanD

Reputation: 61

Try disabling your anti-virus or check your firewall. I disabled my Avast anti-virus and it's working fine for me now.

Upvotes: 4

Wildcard24
Wildcard24

Reputation: 11

I experienced this problem also when I first launched out into Laravel. Your port 8000 is most likely occupied by another service or program. Simply go to your terminal where your project is open, and enter the following command

php artisan serve --port=1000

Then, return to your browser and enter the address, replacing 8000 with 1000, as in

127.0.0.1:1000

This worked for me.

Upvotes: 1

Arun P
Arun P

Reputation: 893

Run commands

php artisan config:clear
php artisan config:cache

Even after completing these steps, if Laravel is still showing error, check your_project/storage/logs/laravel.log.

Upvotes: 2

Toeur Tenh
Toeur Tenh

Reputation: 71

The port 8000 might be used by other in your computer. Try to change port by running in your project in cmd:

php artisan serve --port=1000

then type http://127.0.0.1:1000/ on your browser.

Upvotes: 2

larp
larp

Reputation: 1067

I solved this by running this command instead of PHP artisan serve.

php -S 127.0.0.1:8000 -t public/

Then try to load again 127.0.0.1:8000 in your browser.

Upvotes: 12

Ronak Chauhan
Ronak Chauhan

Reputation: 706

There are several issues may be possible for that.

  1. You have used CDN JS and CSS
  2. Check you route/web.php
  3. Check you log error log file storage/logs/laravel.log

Check above points this will sure give you positive result.

Upvotes: 0

Maulik Shah
Maulik Shah

Reputation: 1050

It sometimes happen because of too many redirection and also sometime because of middleware . so see your whole flow for that page.

Also see your cdn which included in your page because it take too many time if you have too many cdn and your connection is slow. And also try to clear all cache.

Upvotes: 1

Khalil DaNish
Khalil DaNish

Reputation: 567

Try these three commands for clearing cache config:

    php artisan config:cache // clear config cache
    php artisan config:clear // clear config cache
    php artisan cache:clear // clear cache
    php artisan optimize  // To reoptimize the class loader
    php artisan route:cache // clear route cache
    php artisan view:clear // clear view cache

Upvotes: 1

Related Questions