7

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.

1
  • You must be having an error in your code, check in the terminal when you launch the site. You will see an issue written in terminal, so the server crashes and stop working hence loading forever. Commented Aug 17, 2022 at 21:41

11 Answers 11

12

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.

Sign up to request clarification or add additional context in comments.

1 Comment

You can also change the port by "php -S 127.0.0.1:8080 -t public/" and load it to your browser 127.0.0.1:8080
4

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

Comments

3

If you are using xampp

just restart Apache and MySql

Comments

2

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.

Comments

2

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.

3 Comments

C:\\Users\\NOR-AIN\\Desktop\\system\\SimpleBlogProject\\artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #6 {main}
C:\\Users\\NOR-AIN\\Desktop\\system\\SimpleBlogProject\\artisan(37): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #6 {main}
clear error log and try php artisan serve again, now update your Question with complete errror log
1

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

4 Comments

answer updated try the new ones as well mostly this: php artisan view:clear
APP_DEBUG=true APP_LOG_LEVEL=debug enable error loging in your .env file at the root of the project and see if application has any error
Try this and allow php server to fire wall: php -S 0.0.0.0:8000
when there were 2 project opened in IDE on localhost it kept to load only one's page. These 'artisan optimize' did the job .
1

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.

Comments

1

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.

Comments

0

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.

Comments

0

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

Comments

0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.