How to install the mcrypt php extension (to use Laravel 4)
When installing Laravel 4 on a fresh Ubuntu or Debian system, you’ll probably get this error message: “Laravel requires the Mcrypt PHP extension.”
To install the mcrypt php extension, do this:
sudo apt-get install php5-mcrypt
and restart the server
sudo service apache2 restart
By the way, this might be off-topic, but let’s be honest: Laravel is a wonderful thing, but the install instructions are .. well… totally incomplete. It’s impossible to install laravel without doing some additional things that are simply not documented. The official tutorial completely misses the installation of the necessary plugins, necessary mod_rewrite shit and necessary vhost actions.
Go here if you need a full tutorial on how to install Laravel 4 on Ubuntu 12.04 LTS.
I get sudo: apt-get: command not found when I try to install mcrypt – any ideas?
I totally agree. For those of us starting out, it has been a total pain trying to get things started. I wasted countless hours just trying to get Laraval running on MAMP, and got mostly there, but had a ton of issues with basic routing. On the forums, some users suggested trying out Vagrant, and that went a lot smoother, but just tried to create my database and got the missing mcrypt error. I still have not found a bash file that gets everything just right for Laravel. Someone should do a Laravel Vagrant tutorial that explains things in more detail. The best tutorial I have found so far is http://culttt.com/2013/06/17/setting-up-vagrant-with-laravel-4/ – but even that one caused some issues for me. The author graciously pointed me to https://github.com/fideloper/Vaprobash – and that got my LAMP stack up on Vagrant. But still does not help with getting Laravel working on Vagrant. Anyhow, slowly making progress, but I just thought things would be a lot simpler to get started.
Thank you for writing this. Now that we have somewhat decent Internet connections, I wonder if it would be easier to just make a vagrant or something box that is preconfigured with laravel stuff.
Edit: here’s the basic idea https://hashicorp.com/blog/otto.html