Laravel php artisan serve doesn't work - laravel

I have Laravel 5.3.16 installed. I have built my projects and until now it would work properly. but for the past few days I can't connect local host. I use the following command on mac terminal,
php artisan serve
and in terminal it's fine, but on my browser I get an error of server being busy!
can anyone tell me what is the problem?

The issue might be that the time you ran 'php artisan' serve wasn't stopped. You can check this by doing following steps:
Assuming you are on a OSX computer:
Open terminal
Run: ps -ef | grep php
Lookup if there is currently a Laravel process in use.
Get that id that is running the instance and kill it.
kill 012345
Try to run the command: php artisan serve again.

Related

How to RUN LARAVEL after closing all connections

I have shut down my laptop and now how to continue on same project which I had proceeding at beginning,
I started XAMPP but still URL shows NOT FOUND for my directory .
i run it using :php artisan serve
Then URL:http://127.0.0.1:8000
it shows not found page
As laravel and php development environments, I highly recommend these to you.
Windows : https://laragon.org/
Mac OS :https://laravel.com/docs/8.x/valet
At first, open your cmd
Now get into the folder where you started your laravel project
Once you are in the laravel project through CMD run the command "php artisan serve"
Now you may check the URL once again.
I also faced the same issue hence tried to answer.
Thank you.

Laravel Sail is not working properly in Ubuntu 20.04 LTS

Hi i tried to install fresh Laravel project using
Laravel Sail
docker environment. First it was showing me "Docker is not running" error. Then i found out, i needed to start docker as rootless. I solved it, reading this url: [https://docs.docker.com/engine/install/linux-postinstall/].
After that, I successfully installed Laravel using Laravel Sail. Then I ran
./vendor/bin/sail up -d
I was able to view Laravel project in my browser. But when i ran any other artisan commands such as ./vendor/bin/sail artisan route:list or sail commands as sail shell, all the docker containers were forced closed automatically. It shows me this error.
Sail is not running.
You may Sail using the following commands: './sail up' or './sail up
-d'
Any suggestions? I am getting this issue on Ubuntu 20.04 LTS version.
If you are on Windows and using WSL, make sure the WSL Integration is properly set:
Settings->Ressources->WSL Integration + Toggle Linux version
I was using Laradock before installing Laravel Sail. Maybe there were some conflicts. So I backed up all my databases, then I removed all containers using this code. sudo docker rmi -f $(docker images -a -q). Then installed fresh Laravel project and it worked.
Please read my below comment as it is was a better solution for me.
very easy, maybe you don't have permission to run docker.
in Linux first use sudo -s and after user ./vendor/bin/sail up -d
Sail first checks to see if any current docker-compose processes have a status of Exit. If any of them have, then it will forcefully bring down all other services. Which is what you were are seeing whenever you type any sail sub-command. You can see the code here: https://github.com/laravel/sail/blob/87c63c2956749f66e43467d4a730b917ef7428b7/bin/sail#L44-L49
Run sail up to start the processes and then use docker-compose ps to check all services are running and none have an Exit status.
I had the same issue and when reviewing the code and checking my services I noticed the database had exited soon after I brought them up.

How to run laravel artisan command on server?

How to run laravel artisan command on server? I have to run this this command:
composer require realrashid/sweet-alert
If you have access for ssh, login through it.
Check if you have composer by typing composer in terminal else install it.
to Install composer use composer install command in terminal.
go to the root folder in which laravel is installed using cd command.
In the root folder, run the command php artisan in terminal.
It should work fine now.
What if you have Shared hosting?
Just look for terminal in cpanel. See image for ref..
Open it and try for the steps given above.
Thank you!

Run Laravel phpMyAdmin via php artisan serve

I have a Laravel project running with php artisan serve (no Apache or Nginx) on:
http://localhost:8000/
I have then ran this successfully
composer require phpmyadmin/phpmyadmin
My question is, what additions to Laravel's routing etc. must I do to run the following?
http://localhost:8000/phpmyadmin
Though I haven't found a specific way to have
http://localhost:8000/phpmyadmin
working through Laravel as part of php artisan serve, there is a simple solution that works just fine using PHP's native server instead, assuming you have mysql installed as localhost:
composer create-project phpmyadmin/phpmyadmin
cd phpmyadmin
ls -la #files look like classic phpMyAdmin, note however `vendor` folder in place along with package.json
php -S http://localhost:7000 #and you should be able to see and log in!
This does everything I need it to do. If you want to install phpMyAdmin through an actual webserver like Apache that runs always, you're better off doing something like apt-get [or yum] install phpmyadmin and then you'll have a directory override from Apache running:
http://www.mylaravelapp.com/phpmyadmin

Laravel 5 installation on Centos 7 issue

I successfully installed the latest Laravel framework on my Centos 7 VHost.
After the composer command was done installing it, I created a new Laravel project.
For that I went o /var/www/ and created a folder there called "great" , then I changed directory to enter it, so pwd showed me
/var/www/great/
Then I ran this command:
composer create-project laravel/laravel myproject
The last one, created (as expected) a new folder inside the "great" folder called "myproject"
According to the Laravel installation instructions, I changed my directory to be inside the myproject folder and when I run
php artisan -V
I get:
Laravel Framework version 5.0.16
then I ran the command
php artisan serve --host 192.168.1.60 --port 80
with 192.168.1.60 being my vhost's IP address. So i expect to be able to see the Laravel page from my other computer (windows) when I access the ip in my browser, but it's not happening. All I get in my browser is:
ERR_CONNECTION_TIMED_OUT
At first I tried it without specifying the host or the port... same result. Then I discovered that I need to specify the host in order to be able to access the project from locations other than localhost. So I tried accessing it by going for http://192.168.1.60:8000 (because that is it's default port). Same result.
I can ping the IP, on Centos side I do not get any error when I run the artisan serve....
What am I doing wrong?

Resources