Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php artisan serve command works but url not working

Tags:

laravel

In Laravel 5.4,

After running php artisan serve command fresh laravel setup works on this url localhost:8000 but when i try to access with public url localhost/lara54/public. it is not working and gives white blank page. I tried this using virtual host in linux giving folder path upto public but still not working.

php artisan serve command also creates a virtual host what i am missing here to make this setup work with URL.

like image 930
Shakun Chaudhary Avatar asked Feb 20 '17 07:02

Shakun Chaudhary


People also ask

Why php artisan serve is not working?

Reasons why php artisan serve not workingYou are running php artisan serve command in wrong directory. php artisan serve is laravel command only work with laravel project. Check project directory and run in root directory of your project. The requested host or port is not available.

What is php artisan serve command?

The Laravel PHP artisan serve command helps running applications on the PHP development server. As a developer, you can use Laravel artisan serve to develop and test various functions within the application. It also accepts two additional options. You can use the host for changing application's address and port.


Video Answer


2 Answers

Run this command it will work

php -S 0.0.0.0:8000
like image 124
Bercove Avatar answered Sep 21 '22 22:09

Bercove


give permission to following two directories:

storage

bootstrap/cache

i hope its help you

like image 29
Jigneshsinh Rathod Avatar answered Sep 20 '22 22:09

Jigneshsinh Rathod