Sunday, March 22, 2015

Installing Laravel on Ubuntu 14.04

You need to run these commands

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ondrej/php5-oldstable
$ sudo apt-get update
$ sudo apt-get install -y php5 php5-mcrypt
$ sudo apt-get install apache2 libapache2-mod-php5 
$ sudo apt-get install mysql-server php5-mysql
$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo chmod +x /usr/local/bin/composer
$ cd /var/www
$ git clone https://github.com/laravel/laravel.git
$ cd /var/www/laravel
$ sudo composer install
$ sudo chown -R www-data.www-data /var/www/laravel
$ sudo chmod -R 755 /var/www/laravel
$ sudo chmod -R 777 /var/www/laravel/app/storage 
$ sudo vim /etc/apache2/sites-available/laravel.example.conf
 
Paste this code in laravel.example.conf
 
<VirtualHost *:80>
        
        ServerName laravel.example.com
        DocumentRoot /var/www/laravel/public

        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/laravel>
                AllowOverride All
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
 
$ a2ensite laravel.example.conf
$ sudo service apache2 reload 

ERROR: Site laravel.example.com does not exist!

While installing laravel on ubuntu 14.04 i faced this error

ERROR: Site laravel.example.com does not exist!

Solution .

you need to rename the file

cd/etc/apache2/sites-available
sudo mv laravel.example.com laravel.example.conf

sudo a2ensite laravel.example.conf

Laravel Compile issue

While compiling laravel i faced this error

  Problem 1
    - Installation request for laravel/framework v5.0.16 -> satisfiable by laravel/framework[v5.0.16].
    - laravel/framework v5.0.16 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system.

Solution :

 sudo php5enmod mcrypt
 sudo service apache2 restart