2

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. enter image description here

3
  • You should really be setting up a virtualhost (guessing you're using Apache) and point it to the public folder Commented Aug 16, 2016 at 10:05
  • yes ! i tried virtualhost too and still same problem as above ! Commented 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 . Commented Aug 16, 2016 at 10:44

3 Answers 3

1

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

Sign up to request clarification or add additional context in comments.

3 Comments

would you suggest me to make configure virtual host, when project folder is outside of the /var/www/html folder .
@MadhuSudhanSubedi But why you want to keep project outside php server directory.
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.
0

You may activate the rewrite mode of apache it Will work.

3 Comments

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.
would you suggest me to make configure virtual host, when project folder is outside of the /var/www/html folder .
0

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

Now problem solved ! would you suggest me to make configure virtual host, when project folder is outside of the /var/www/html folder .
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.
The above should be easier and get you started faster. For a virtual host approach, check this tuts.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.