laravel 6.9 localhost keep loading than Not found - laravel

I download a fresh laravel project from someone for testing.
After setting up and running using php artisan serve, the locahost (http://localhost:8000/) keep loading slowly then It shows message 404 not found.
I have tried to solve using command line php artisan serve --port=1010 and run http://localhost:1010/ on broswer but It didn't work.
And I also used php -S localhost:8000 -t public or php -S 127.0.0.1:8000 -t public after run localhost:8000 on broswer but it still didn't work.
any idea?

Check once there is storage/framework/cache/data and storage/framework/sessions directory created or not, if those doesn't exist then create manually.

Related

Laravel: local running the application with ASSET_URL set to local port loads forever

I am new with Laravel.
The app runs perfectly fine in the production but when running it locally it takes lot of time to load even for a simple login page (something around 15min).
I tried running it with command:
php artisan serve
and:
php -S 127.0.0.1:8000 -t public/
Tried removing:
APP_DEBUG=true
But nothing helped. Also tried:
php artisan view:clear
php artisan route:cache
But I get an error as lot of routes use closure and changing them is lot of effort.
It loads rapidly when I remove or change url in .env for ASSET_URL.

My laravel project works great on xampp but when I try and run it using php artisan serve it times out

I have a strange issue where I can run my Laravel project that uses mysql perfectly when using xamp php 7.2 , So normally if it runs well in xampp it should run well if I just decide to use php artisan serve and access it via http://127.0.0.1:8000/ But to my surprise it doesn't'.
If I use php artisan serve the debug message I get from my Laravel project is
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)
Maximum execution time of 60 seconds exceeded
I tried giving full permissions to all folders as well as run the following commands:
composer update
composer dump-auto-load
php artisan serve
Any one else experience this strange issue? Where it works perfect in xampp but if you cd to the project directory and run php artisan serve, it just times out.
If you are using the PHP's default web server (eg. php artisan serve) you need to restart your server after any changing your php.ini file values.
Try to run in a different port.
php artisan serve --port=8080
and if still doesn't work, set time limit to your controller, in __contruct function,
public function __construct()
{
set_time_limit(300);
}
This problem is occering due to maximum execution time defined on php configuration. As common factor please use following:
ini_set('max_execution_time', 300); //300 seconds = 5 minutes
Add the above lines at the top of your server.php file.

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.
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.
Try disabling your anti-virus or check your firewall.
I disabled my Avast anti-virus and it's working fine for me now.
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.
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.
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
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.
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.
There are several issues may be possible for that.
You have used CDN JS and CSS
Check you route/web.php
Check you log error log file storage/logs/laravel.log
Check above points this will sure give you positive result.
In my case I uninstalled Xampp and reinstalled it(I'm assuming you are using Xampp too).It worked for me.
If you are using xampp
just restart Apache and MySql

Url redirects to xampp page instead of main site | Laravel

I an trying to setup a site locally but for some reason, everytime I try to browse the main url I redirects me to localhost.
I cloned the repository, ran composer update, created a new .env and ran php artisan key:generate
Afterwards I ran php artisan serve command and it gave me the url:
<http://127.0.0.1:8000>
When I type that url in the browser, the page redirects me to the following url:
http://localhost/dashboard/
The following is the full path to the website:
C:\xampp\htdocs\lrvl-absa-onboarding-v1
Anything I am doing wrong with the setup ?
Just use the php artisan command and then go to 127.0.0.1:8000 on your browser. Make sure youre using the 8000 port

Artisan Error: Failed to listen on localhost:8000 (reason: An attempt was made to access a socket in a way forbidden by its access permissions. )

I'm having problem starting my laravel installation. Whenever I type in the terminal php artisan serve, it throws me an error like below:
c:\wamp\www\blog>php artisan serve Laravel development server started
on http://localhost:8000/
[Sat Nov 05 21:18:39 2016] Failed to listen
on localhost:8000 (reason: An attempt was made to access a socket in a
way forbidden by its access permissions.)
1) First firewall restore to default
2) change artisan serve port using this command php artisan serve --port=3232
Trust me its works :)
I faced the same problem today. I just restarted the my machine, after that tried with the same port and it works!
Change artisan serve port using this command
php artisan serve --port=####
instead #### you can enter your own port number.
This will work sure.!
You need command prompt to run as administrator, that solves the problem most of the time.
First make sure your installed Laravel properly in your local machine.
When you execute php artisan serve , you better to run it with administrative priviledges.
In linux, I use
sudo php artisan localhost:8888 -t public
Make sure other requirements such as php version are upto date.
PHP >= 5.5.9
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
For more information refer this document.

Resources