Ubuntu – Laravel loading error in Ubuntu 14.04

laravelPHP

When I tried to access my laravel after successfull updation, instead of the default page it shows an error in the webpage.

Mcrypt PHP extension required. 

I have tried some fixes like this,

sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/apache2/conf.d/20-mcrypt.ini
ln: failed to create symbolic link ‘/etc/php5/apache2/conf.d/20-mcrypt.ini’: File exists
sudo service apache2 restart

Best Answer

  • PHP version: PHP 5.5.9
  • Ubuntu: 14.04

After a lot of trial and error and searching around, this is what I discovered.

getting artisan command working

i did a lot of trial and error so each time i run the php5enmod command before, i had error messages. but on fresh install there was no error messages. after this step i got artisan command working

sudo rm /etc/php5/mods-available/mcrypt.ini
sudo apt-get purge php5-mcrypt
sudo apt-get install mcrypt
sudo apt-get install php5-mcrypt
sudo php5enmod mcrypt

fixing the browser error

sudo nano /etc/php5/apache2/php.ini

add the following line under the dynamically compiled extensions section of php ini

extension=mcrypt.so

restart the apache server, purge the laravel cache and everything working.

Related Question