I am just add the laravel project inside of the /var/www/html folder. When I run the application in browswer using url
http://localhost/voting_lession/public/ It works fine, but it's any routes does not work, error is like this.
-
You should really be setting up a virtualhost (guessing you're using Apache) and point it to the public folderMark Twigg– Mark Twigg2016-08-16 10:05:37 +00:00Commented Aug 16, 2016 at 10:05
-
yes ! i tried virtualhost too and still same problem as above !Madhu Sudhan Subedi– Madhu Sudhan Subedi2016-08-16 10:08:13 +00:00Commented Aug 16, 2016 at 10:08
-
would you suggest me to make configure virtual host, when project folder is outside of the /var/www/html folder .Madhu Sudhan Subedi– Madhu Sudhan Subedi2016-08-16 10:44:44 +00:00Commented Aug 16, 2016 at 10:44
Add a comment
|
3 Answers
instead of http://localhost/voting_lession/public/ Try index.php after your url it might be the issue http://localhost/voting_lession/public/index.php
3 Comments
Madhu Sudhan Subedi
would you suggest me to make configure virtual host, when project folder is outside of the /var/www/html folder .
Veerendra
@MadhuSudhanSubedi But why you want to keep project outside php server directory.
Madhu Sudhan Subedi
Because I want to manage different category of projects in different folder, for e.g. test related projects in one directory, office projects in another directory. I do not want add all the projects inside of server directory. Again I want to projects accessible using domain name that's why.
You may activate the rewrite mode of apache it Will work.
3 Comments
Madhu Sudhan Subedi
I enabled the rewrite mode of apache, and I am giving the 755 permission for the /var/www/html folder But does not work again.
W. Bilel
Madhu Sudhan Subedi
would you suggest me to make configure virtual host, when project folder is outside of the /var/www/html folder .
Do check the path to your file for correctness in spelling; if your localhost is up as you said and Laravel properly installed, that is likely to be the problem.
3 Comments
Madhu Sudhan Subedi
Now problem solved ! would you suggest me to make configure virtual host, when project folder is outside of the /var/www/html folder .
nyedidikeke
Run the following Artisan Command: php artisan serve --port=8080, where 8080 corresponds to the port number you would like to avail your project on. Check Running PHP's Built-in Web Server for more details.
nyedidikeke
The above should be easier and get you started faster. For a virtual host approach, check this tuts.