Tuesday, 13 September 2016

How to install laravel for PHP web application developement

Laravel is an open source PHP framework, designed for the faster development in PHP. I have used almost all framework like zend, yii2, codeiginiter and etc but laravel is one which i recommened to use for PHP developement. Laravel is built to be simple, easy to learn and supports rapid application development. Laravel comes with a new template engine called "Blade".The feature of using blade template is its allow you to write plain PHP in your template.

Laravel PHP



Some key features of laravel:
  • Restful routing is easy.
  • Composer – An amazing tool that lets you manage your application’s third-party packages easily.
  • Built-in unit testing with easy syntex.
  • A lightweight Blade Templating Engine.
  • A huge community catering to thousands of programming geeks and application developers.


System requirements to install laravel framework:
  • PHP >= 5.4
  • Mcrypt PHP Extension
  • OpenSSL PHP Extension
  • Mbstring PHP Extension
After all lamp configuration you need a composer to download laravel and dependency from remote.

# installing composer
curl -sS https://getcomposer.org/installer | php
# move composer globally
sudo mv composer.phar /usr/local/bin/composer
# check composer working
composer

Install Laravel via Laravel Installer : First, download the Laravel installer using Composer

composer global require "laravel/installer"

Once installed, the laravel new command will create a fresh Laravel installation in the directory you specify. For instance, laravel new blog will create a directory named blog containing a fresh Laravel installation with all of Laravel's dependencies already installed.

laravel new blog (This command will create a laravel project named blog)

Via Composer Create-Project:

composer create-project --prefer-dist laravel/laravel blog

chown -R www-data.www-data /var/www/blog
chmod -R 755 /var/www/blog
chmod -R 777 /var/www/blog/app/storage

Installing the dependency of laravel using:

# installing using composer
composer install

Now set the 32 bit long random number encryption key, which used by the Illuminate encrypter service.

#genreate a application key
php artisan key:generate

Now edit config/app.php configuration file and update above generated application key.Also set the cipher.

'key' => env('APP_KEY', 'k3HTNu3A21Kt73loyr2Py9blU2J4XQ75'),
'cipher' => 'AES-256-CBC',

Create a virtual host for laravel blog(directory) and create virtual host like blog.laravel. If you don't how to create a virtual host in ubuntu please read the article here and after creating virtual host access your project in browser start building an awesome application with laravel.





Featured post

How to create dynamic schema in mongodb

Sometime what we need in our application is to create mongodb schema for collection and some of our collection schema are same but names are...

Popular Posts