1

I am working on an error for the last 2 or 3 hours and couldn't find anything. I am trying to start a old laravel app that uses old php.

There is a problem starting it because php 7 and above can not support the mcrypt.

Does anyone have any solution to start the app properly. Thank you for your time.

This is the screen shot of the error:: error image

mischva11
  • 2,811
  • 3
  • 18
  • 34
  • 3
    Your question title is about installing mcrypt in PHP7. But then in the text you state that you already know this is not supported (the docs make this clear: http://php.net/manual/en/intro.mcrypt.php) ...so your title does not match your question. What do you actually want to do? Install an older version of PHP? If you prefer to change your application to work in PHP7, then that link suggests you a couple of alternatives. https://stackoverflow.com/questions/41272257/mcrypt-is-deprecated-what-is-the-alternative might also be a useful resource. – ADyson Aug 30 '18 at 11:41
  • 1
    i am asking if it is a possibility to install it anyway or work with two different php versions – Endrit Sheholli Aug 30 '18 at 11:45
  • *"because php 7 and above can not support the mcrypt"* ... technically it's only deprecated until 7.2 (when it's removed) - you can use mcrypt with 7.0 and 7.1 (if you switch off deprecated warnings). – CD001 Aug 30 '18 at 11:47
  • Maybe you'd be able to install it, but I don't know and I would not recommend it. It's dead (as of PHP 7.2. If you have 7.1 you should able to use it easily). IMHO you should not really attempt to use something which has been deliberately removed due to security concerns. In the short term you might need to but you should have a plan to replace it. However it is possible to install two versions of PHP. There are plenty of blogs about it. Find one for your platform. – ADyson Aug 30 '18 at 11:47
  • this is a old project actually and setting it up would be helpful but thank you for your time and help, you helped a lot my friend. – Endrit Sheholli Aug 30 '18 at 11:49
  • @CD001 how should i do that – Endrit Sheholli Aug 30 '18 at 11:51
  • According to http://php.net/manual/en/migration71.deprecated.php it is now located in the PECL repository (http://pecl.php.net/) and you may be able to retrieve it from there and use it. But as stated there and in the comments here: https://stackoverflow.com/questions/50891547/i-want-to-make-mcrypt-work-on-xampp-windows-with-php-7-2-error-call-to-undefine it's been abandoned as a project and has outstanding bugs from long before PHP decided to remove it. Not a good state of affairs for an encryption tool. – ADyson Aug 30 '18 at 11:51
  • "how should i do that"...you mean switch off deprecated warnings? It's quite easy to google that. – ADyson Aug 30 '18 at 11:52
  • i understood what he said but it is not doing the trick – Endrit Sheholli Aug 30 '18 at 12:05
  • well the message in your question is an exception, not a deprecation warning. What CD001 said would only apply if you used PHP 7.1 and had mcrypt actually installed. AFAIK you have neither currently. – ADyson Aug 30 '18 at 13:04

0 Answers0