Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run laravel 5.0 project on localhost without use php artisan serve

I have created a laravel 5.0 project with php artisan serve, now i need to know how to run laravel 5.0 project run without start php artisan serve, i have already browse lot of websites no one help me..

like image 305
Ravi Avatar asked Jun 25 '15 09:06

Ravi


People also ask

Why use php artisan serve?

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.


2 Answers

You need to change "server.php" to "index.php" then copy ".htaccess" from public to root directory.

See: https://stackoverflow.com/a/30053989/3948755

like image 99
Ricardo Vigatti Avatar answered Sep 22 '22 06:09

Ricardo Vigatti


Laravel sever Folder is "public". There is an index.php so you can run you project from there.

Suppose if you using UbuntuOS then you have to create your local server in public directory. Suppose your folder name is laravel_test then go in that directory and run some thing like this

php -S localhost:8000 -t public

If you using windows then access public folder from URL.

localhost/laravel/public

Actually it's bad practise to access folder from URL but for local its good. You also can go with host entry. Just make sure that your target folder is "public" directory.

like image 34
Gautam Patadiya Avatar answered Sep 21 '22 06:09

Gautam Patadiya