How to install Laravel in Linux
1.) Go to your Root directory by CLI (Command line interface).
2.) We have to need "PHP mcrypt" extension module be enabled.
To enable it, run this command in the terminal.
sudo php5enmod mcrypt
after that restart the Apache web server to load the mcrypt module:
sudo service apache2 restart
to check if mcrypt is enabled or not:
php -m | grep mcrypt
3.) Go to your WebRoot direcory (var/www/html) and run this command in terminal
sudo curl -sS https://getcomposer.org/installer | sudo php
sudo mv composer.phar /usr/local/bin/composer
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
4.)Finally, we are ready to actually install the Laravel framework, after completing these steps.
2.) We have to need "PHP mcrypt" extension module be enabled.
To enable it, run this command in the terminal.
sudo php5enmod mcrypt
after that restart the Apache web server to load the mcrypt module:
sudo service apache2 restart
to check if mcrypt is enabled or not:
php -m | grep mcrypt
3.) Go to your WebRoot direcory (var/www/html) and run this command in terminal
sudo curl -sS https://getcomposer.org/installer | sudo php
sudo mv composer.phar /usr/local/bin/composer
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
4.)Finally, we are ready to actually install the Laravel framework, after completing these steps.
composer create-project laravel/laravel laravel --prefer-dist
5.) copy all files of public folder and paste out side of public folder ,
5.) copy all files of public folder and paste out side of public folder ,
after that Open the index.php in the laravel folder in a text editor and
replace the two occurrences of __DIR__.'/../bootstrap/autoload.php'
with __DIR__.'/bootstrap/autoload.php'.
Essentially, you are removing
/.. from the path. Save the index.php file.
Either you can start by CLI using this command : php artisan serve
*************************************************************************************************************************************
We are ready to test the Laravel installation! Open your web browser and enter http://projects.local/laravel/ in the address bar.