3

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

8
  • 1
    That's the ini file for command line, what about the ini file for your web access? They can be different. Commented May 9, 2014 at 10:42
  • Remember that the command line PHP runs a different interpreter to the one used for your web server. ! Commented May 9, 2014 at 10:42
  • @MarkBaker how do I check the ini file used on web access? Commented May 9, 2014 at 10:44
  • @belyid, execute phpinfo() in a file on the website, instead of command line, and see which ini file is being loaded. Commented May 9, 2014 at 10:47
  • @MarkBaker I can't see the module mcrypt on phpinfo() page. Commented May 9, 2014 at 10:49

2 Answers 2

5

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!

Sign up to request clarification or add additional context in comments.

1 Comment

I've already done that without success.
0

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.