Laravel 4 Installation and Getting Started Tutorial _php example

Source: Internet
Author: User

I. Installation of composer

First you need to install Composer,composer is a PHP dependency management tool, Laravel Framework is to use Composer to perform installation and dependency management.
Note:
(1) If the installation composer error, open the Php_openssl,php_fileinfo extension in the php.ini, because Laravel need.
(2) During the installation process, choose the correct php.exe position

Two. Install Laravel

Composer installation is complete, in cmd, your website directory executes the following command:

 
  
  
  1. Composer Create-project Laravel/laravel Your-project-name


Composer will automatically help you download Laravel and install.


Three. Deploying a virtual Host

For example, my project name is Project:

 
  
  
  1. <virtualhost *:80>
  2. DocumentRoot "E:/www/project/public"
  3. ServerName Laravel.dev
  4. ErrorLog "Logs/laravel.log"
  5. Customlog "Logs/laravel.log" common
  6. </VirtualHost>


Of course, you also need to bind the domain name in your hosts:

 
  
  
  1. 127.0.0.1 Laravel.dev


At this point, the installation is complete:

Four. Realize Hello World

Print Hello world with routing implementation, add in app/routes.php:

 
  
  
  1. Route::get (' Test ', function ()
  2. {
  3. Return ' Hello world! ';
  4. });

Because the Laravel template uses a blade, so in the following tutorial to introduce controller or view-related!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.