Wednesday, November 11, 2015

Running laravel projects on localhost

Firstly, you have to modified your hosts file on windows..


Open the following file with admin rights.
C:\Windows\System32\drivers\etc\hosts

Add whatever site you want to match with localhost

127.0.0.1 yourname.com
localhost yourname.com

Modified httpd-vhosts.conf file from the following folder if you're using xampp for windows

C:\xampp\apache\conf\extra\httpd-vhosts.conf

Add a new virtual host file

<VirtualHost *:80>
    DocumentRoot "C:\xampp\htdocs\laravelprojects\yourproject\public"
    ServerName yourname.com
ServerAlias www.yourname.com
    <Directory "C:\xampp\htdocs\laravelprojects\yourproject\public">
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

And restart the apache.



No comments:

Post a Comment