Question

I'm trying to install Laravel on Linux Ubuntu. I'm running Ubuntu 14.10.

Everything worked alright. But now instead of getting the supposed page when accessing localhost I get the message: " Mcrypt PHP extension required " I'm copying some information from terminal to help pinpoint the problem.

 which php
/usr/bin/php

php --ini
Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File:         /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d
Additional .ini files parsed:      /etc/php5/cli/conf.d/05-opcache.ini,
/etc/php5/cli/conf.d/10-pdo.ini,
/etc/php5/cli/conf.d/20-json.ini,
/etc/php5/cli/conf.d/20-mcrypt.ini,
/etc/php5/cli/conf.d/20-mysql.ini,
/etc/php5/cli/conf.d/20-mysqli.ini,
/etc/php5/cli/conf.d/20-pdo_mysql.ini,
/etc/php5/cli/conf.d/20-readline.ini

php -v
PHP 5.5.9-1ubuntu4 (cli) (built: Apr  9 2014 17:11:57) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

php -m
mcrypt

The command php -m says that I have mcrypt module, but if I load a page containing

<?php phpinfo(); ?>

I can't see any mcrypt module. I only see mcrypt on the "Module Authors".

I don't know how to get Laravel to work...

Any help would be greatly appreciated.

Best regards

Was it helpful?

Solution 2

You need to check which ini file is being loaded. PHP CLI, and PHP server can sometimes run different config files.

Create a page with:

    <?php echo phpinfo(); ?>

then see which ini file is being loaded.

OTHER TIPS

Installing the php5-mcrypt doesn't automatically enable the module. Maybe you have to enable it manually:

Install the module

apt-get install php5-mcrypt

Create an auxialiar symlink and enable the module

cd /etc/php5/mods-available
ln -sf ../conf.d/mcrypt.ini .
php5enmod mcrypt

And reload apache

service apache2 reload

Hope it helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top