Local Laravel server stops after hitting localhost once - php

I'm trying to develop a Laravel app locally and I'm running php artisan serve. It works until I visit localhost:8000 and then the server stops. I've tried changing the port using sudo php artisan server --port=80 but that doesn't fix it.
I haven't written a line of code yet. If it helps I'm running PHP 5.4 on OS X Mavericks.

i think your experiencing segmentation fault(core dumped),
try running this commands
composer dump-autoload
php artisan clear-compiled
composer clear-cache

Please check if you have Avast Antivirus. This antivirus detects server.php as a threat (silently) and blocks it.
As a result, browser works good for the first request and then keeps waiting. Noting comes up on subsequent requests. Solution is to add an exception in antivirus. This problem is specific to Laravel.

If you are using Avast Antivirus, this will delete the server.php file assuming as a threat. You have to create an exception for this. Goto Avast Anitvirus -> Menu -> Settings -> General -> Exceptions. Add exception server.php file path here (add server.php file if it doesn't exist) and run the "php artisan serve" command.

Related

Laravel `php artisan serve` throws error without meaning

When running php artisan serve I get the error message:
$ php artisan serve
Starting Laravel development server: http://127.0.0.1:8000
sh: line 0: exec: : not found
Starting Laravel development server: http://127.0.0.1:8001
sh: line 0: exec: : not found
It will repeat trying to start on other ports but without success.
My installation worked fine a couple of days ago and I did not do any manual updates. What does the error message mean?
I also tested to setup a new Laravel project with laravel new test and I can properly launch this. So I assume that all my tools are still correctly installed.
I solved it by myself. I had some wrong variable in my .env file which messed up my php path. I deleted it and now everything runs fine:
PHP_BINARY="/opt/plesk/php/7.4/bin/php"
I used this to debug the site on my shared hosting server. Thanks everyone in the discussions for the good hints.

PHP artisan error: CLI stops working after every reboot

I installed Laravel through composer using PHP 7.3.25 through xampp v3.2.4. I first noticed the problem: cli stopped working, during
php artisan serve
I scoured SO and the internet for possible fixes. Going through these commands fixed this problem for me (or so I thought):
composer update --no-scripts
php artisan clear-compiled
composer dump-autoload
But every time I turn on the PC, I get the same error and have to follow these steps to make it work. Antivirus did not have anything to do with it (I checked). Is there any way to fix this without having to completely reinstall everything?
Its ist important to understant few points related to following queue:restart command.
The queue workers' age confirmed that they restarting in response to that.
php artisan queue:restart
Ref: https://laravel.com/docs/8.x/queues#queue-workers-and-deployment

I'm facing problem in laravel that is "This site can’t be reached 127.0.0.1 refused to connect."

I face this error only when "php artisan serve" command is not running. If this command is running then there is no such a error, but as i closed command prompt this error occurs. i have also changed port but no vain.
Kindly help me.I would like to mention here that I'm using Window 10 OS.
Thanks in advance.
If you don't have a HTTP server (like WAMP or similar installed), you'll need to keep the Command Prompt / Terminal window running at all times. Closing the window or stopping the php artisan server command will terminate the server that's running the website.
If you want a persistent server, you should look into server software like WAMP or XAMPP.
Note that this is expected behavior for the php artisan serve command.
because with this kind of server (like: LARAGON), running 'php artisan serve' is necessary, so if you close the terminal, 'php artisan serve' will automaticaly stop running, then the server will stop too, then you can't reach anymore your localhost.
If you want a persistent server, you should look into server software like WAMP or XAMPP.
Note that this is expected behavior for the
php artisan serve command

Laravel server not starting

I have a fresh installed laravel app and when i run php artisan serve it shows me the server information but when i go to that server it gives a cant be reach error. I am not running Vagrant just MAMP but it used to work before. I did tried to install Vagrant in the past and it didn't work that is why i came back to MAMP only. I read something about generating a key with php artisan key:generate which didn't work. Any help is appreciated.
This is the command I am using and the result
$ php artisan serve
Laravel development server started: <http://127.0.0.1:8000>
try to uninstall the antivirus if you have one ,in my case i uninstall avast ,reboot OS and it works for me .

Laravel Project not working in XAMPP htdocs folder.What could be the reason of this?

Error States:
The localhost page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500
my project is in htdocs>laravel>project1>public>index.php
any more details like installation etc?
how did you install the laravel project by php artisan command or by composer or by zip package? and why you want to run your laravel project with the xammp file structure.. you can simply write the "php artisan serve" in your command line.. also make sure the .env variables set properly.. also try to clear all cache browser and run following query and try again
php artisan cache:clear
you need to know that the default port of laravel project is localhost:8000
When you meet 500 error, it's usually permissions related problem. Set write permissions on a storage directory. For Linux:
sudo chmod -R 775 storage
If it didn't help, look into Laravel error log.

Categories