简体   繁体   中英

Why can't I run my laravel app with PHP artisan serve?

I'm working on a laravel app. I made the simple installation of a new laravel app, and in the previous days it was running great.

But now I'm not able to access my project in browser after running php artisan serve. The browser just says page not found and the buffering of that page is like infinite.

I tried to run the server in a different port with:

php artisan serve --port=9000

and then accessed it in http://127.0.0.1:9000/

It run well once, but then it stopped again.

It didn't work for me but I used composer:

php artisan serve --port=9000 

Then it hanged. I press CTRL + C and I got it working without any errors

You could try out the following:

  • php -S localhost:8000 -t public To run withe inbuilt PHP server
  • Make a fresh installation of a laravel project and copy your files into it.

Try this, I got solved by these;

1) Change the default url to like this - localhost/<your-project-name>/public/ instead of default one 127.0.0.1:8000

or

2) use this php -S localhost:8000 -t public or php -S 127.0.0.1:8000 -t public

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM