Laravel Tutorial: laravel 4 installation and getting started

Source: Internet
Author: User
Tags laravel tutorial

1. Install composer
First, you need to install composer. composer is a PHP dependency management tool. The laravel framework uses composer for installation and dependency management.
Note:
(1) If an error occurs while installing composer, enable php_openssl and php_fileinfo extension in PHP. ini because laravel needs.
(2) During the installation process, select the php.exe location of your instance.

Ii. Install laravel
After the composer installation is complete, run the following command on your website directory in cmd:

 

composer create-project laravel/laravel your-project-name

Composer automatically downloads and installs laravel for you.

3. Deploy Virtual Hosts


For example, my project name is project:

<VirtualHost *:80>DocumentRoot "E:/www/project/public"ServerName laravel.devErrorLog "logs/laravel.log"CustomLog "logs/laravel.log" common</VirtualHost>

Of course, you also need to bind a domain name to your hosts

127.0.0.1       laravel.dev

So far, the installation is complete:

4. Implement Hello World
Print Hello world through routing and add the following in APP/routes. php:

Route::get(‘test‘, function(){    return ‘Hello World!‘;});

 

Laravel Tutorial: laravel 4 installation and getting started

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.