Laravel setup in Linux machine ? yea its good to use Linux for framwork like Laravel, Symfony or Zend. It doesn’t means Win/Mac not good but linux is best in my concern.
I’m using Linux mint for developing Laravel app. so the basic configuration set up will explain step by step. Hope you are in Linux environment other wise this article doesn’t suit for your requirement.
First make sure you have latest PHP version installed, If you need Apache installation help, look at below.Step 1: Apache Installation
Open your terminal and type
Step 2: Mysql Installation
sudo apt-get update
sudo apt-get install apache2
simply type following commands.
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
during the installation mysql ask for root password if you don’t want to create a password for default user root means like to access mysql without password. simply follow the steps. you have to install phpmyadmin for linux debain
in the following path /etc/phpmyadmin/config.inc.php.
uncomment this line
Step 3: PHP Installation
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
type the following commands.
Step 4: Some useful tools
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt
apt-get install git
sudo apt-get install curl
Install Composer and Node and so on
sudo apt-get install vim
curl -sS http://getcomposer.org/installer | sudo php -- --filename=composer --install-dir=/usr/local/bin
Then open ~/.bashrc file using following command.
paste the following line
then save it and type
So that all the composer packages are executable.
sudo apt-get install nodejs npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g bower
sudo apt-get install php5-curl
composer global require "laravel/envoy=~1.0"
sudo apt-get install php5-mcrypt
composer global require "laravel/installer=~1.1"
Creating your first empty Laravel project
Create a Development folder and enter it
Create a new Laravel install and give the files the correct permission
laravel new homestead
chmod 755 -R storage/
Create a homestead.conf file for apache and get into editing mode
sudo touch /etc/apache2/sites-available/homestead.conf
sudo vim /etc/apache2/sites-available/homestead.conf
While in the file paste whats next then type “:wq” of course do not forget to replace “User” with the linux user you are using.
Require all granted
Options Indexes FollowSymLinks Includes ExecCGI
When that has been done open up
sudo vim /etc/hosts
Then you should be able to do
sudo a2ensite homestead.conf
Then simply restart apache
sudo service apache2 restart
then navigate to homestead.app in a browser.
All done! you setup your first Laravel project!.
Its quite simple and easy right ? more Laravel related article will coming soon.