Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to install Laravel5 using composer

    • 0
    • 0
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 434
    Comment on it

    This tutorial will help a user to install Laravel5 a framework in php with the help of a composer. The basic requirements to install Laravel5 are as mentioned below:

    PHP >= 5.4

    Mcrypt PHP Extension

    OpenSSL PHP Extension

    Mbstring PHP Extension

    Tokenizer PHP Extension


    1. Run the below command to get the latest composer version

    2. curl -sS https://getcomposer.org/installer | php
    3. For globally running the composer we can move composer.phar to the a path "/usr/local/bin/composer" using the command:
    4. "mv composer.phar /usr/local/bin/composer"
    5. Test if the composer in working fine.

    6. type in terminal=> "root@username:/var/www/html# composer"
    7. Now we will install our laravel5 project.

    8. select a directory in which we want to install laravel5

      4.1> root@username: cd /var/www/html

      4.2> root@username: /var/www/html# composer create-project laravel/laravel projectfolder_name

      if laravel is installed successfully we will find the following message at last

      Generating autoload files

      Generating optimized class loader

      Compiling common classes

      Application key [wkB1eMQ7bUtbwKDCIWrfByhT2R9AyY8I] set successfully.


    9. Laravel by default has a directory named public which is intended to be the document root of the web server.So we have to launch PHPs internal web server and say that the document root is the public directory of our Laravel installation.For this we need to execute the below command:

    10. root@username:/var/www/html# php -S localhost:8888 -t public

      Understanding the above command in parts:

      5.1>The php part is to run php in our project.

      5.2>The "-S localhost:8888" part tells PHP to launch the internal web server at the address localhost on port 8888.

      5.3>This means that we can open a browser and type http://localhost:8888 and we can see our Laravel 5 project.

      5.4>The "-t public" part tells PHP that the web servers document root is the public directory.

 1 Comment(s)


  • Composer has made it really easy to install frameworks and dependencies. Since Laravel 5.6 is out now, if you want to install and older supported version you will have to enter following command in ssh

    For download:
    composer global require "laravel/installer"
    To create new directory
    laravel new blog
    Or use following
    composer create-project --prefer-dist laravel/laravel blog "5.5.*"
    The process is really quick unless you are using some Laravel hosting provider where you don't have to setup stack first.
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: