2
votes

Laravel works fine local, but on the server I get the following:

Laravel requires the Mcrypt PHP extension.

However I can't install mcrypt on my server because i have no admin rights. The process for installing the module at the server in my corporation would be to painful, it would be better to just go with another framework instead. But Laravel seems so modern and beautiful that I can't let it go without asking this question: Is it somehow possible to run Laravel without php-mcrypt?

3

3 Answers

6
votes

No, Laravel really requires the MCrypt Extension. You could, however, ask your hosting provider to install the MCrypt extension.

If you decide not to use Laravel, instead take a look at Symfony. Symfony is another very powerful framework and Laravel makes use of quite some of Symfony's features.

Link: http://symfony.com/

Symfony doesn't require this plugin to be installed, however it requires the following plugins (but I assume those are installed at every hosting provider):

  • PHP >= 5.3.3
  • JSON enabled
  • ctype needs to be installed
  • The php.ini needs the date.timezone setting

I hope I helped you further :)

EDIT: Newer versions of Laravel don't need to have Mcrypt!

2
votes

Yes, the Laravel composer.json file states that your application requires ext-mcrypt which can be faked by installing another package which states that it provides ext-mcrypt.

One you've gotten past the composer install, by default Laravel will still try to call mcrypt functions for encryption. But this can be prevented by creating your own encryption service provider that not require crypt.

I've created the package https://github.com/thomaswelton/laravel-mcrypt-faker.

You can use this to disable encryption for Laravel, or by using openssl encryption that you may already have available.

Note that disabling encryption is not at all advised for production applications. But the package may be useful when you just want to play around with Laravel without installing the mcrypt extension, or where you have the openssl extension available.

0
votes

Installing dependencies on the wrong environment is now possible

The new --ignore-platform-reqs flag for the install and update commands lets you install dependencies even if you have the wrong php version or are missing one of the required php extensions. It's not really recommended but it can be useful sometimes if you want to run composer outside a VM for example and you only have the right extensions installed in the VM where you run the code.