21.11.2014 Views

Laravel Starter - PHP User Group (Myanmar)

Laravel Starter - PHP User Group (Myanmar)

Laravel Starter - PHP User Group (Myanmar)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Laravel</strong> <strong>Starter</strong><br />

In Linux and OSX, simply add the following line to your /etc/hosts file:<br />

127.0.0.1 myfirst.dev<br />

Windows users should add that line to their c:\windows\system32\drivers\etc\<br />

hosts file.<br />

Now you should be able to ping myfirst.dev and see that it resolves to 127.0.0.1.<br />

Step 4 – Setting up your VirtualHost<br />

Now that we have a host name we need to tell our web server where to find the <strong>Laravel</strong><br />

installation. Add the following VirtualHost configuration to your Apache web server<br />

configuration and replace DocumentRoot with the path to your <strong>Laravel</strong> installation's<br />

public directory.<br />

<br />

ServerName myfirst.dev<br />

DocumentRoot c:/sites/myfirst/public<br />

<br />

It's very important to note that DocumentRoot points to the <strong>Laravel</strong>'s public directory.<br />

There are multiple security reasons for this. A momentary server misconfiguration can<br />

expose the secure information, such as your database passwords.<br />

Step 5 – Restarting your web server and testing<br />

Now that you've installed the <strong>Laravel</strong> files, added your host declaration, and updated your<br />

web-server configuration you're ready to go! Restart your web-server software and go to<br />

http://myfirst.dev in your browser. You should see the <strong>Laravel</strong> splash page!<br />

And that's it!<br />

By this point, you should have a working installation of <strong>Laravel</strong> and are free to play around<br />

and discover more about it.<br />

6

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!