0

I am using PHP version 7.0.13 I have already installed the mcrypt package successfully.

$mcrypt -v
Mcrypt v.0.9.9 (x86_64-unknown-linux-gnu)
Linked against libmcrypt v.2.5.8
Copyright (C) 1998-2002 Nikos Mavroyanopoulos (nmav@gnutls.org)

and also

$php -m
[PHP Modules]
...
mcrypt
pcre
...

But when I use phpinfo() to check, the webpage dosen't show mcrypt information and the browser returns the error

Fatal error: Uncaught Error: Call to undefined function mcrypt_list_modes()

if I call the function.

Is there any one can help me with this?

Chillie
  • 1,030
  • 10
  • 28
  • 4
    If you look at the docs for *any* mcryopt function you will see a prominent red box that says "Warning: This function was DEPRECATED in PHP 5.5.0, and REMOVED in PHP 7.0.0. " so switch your code to OpenSSL. – Sammitch Dec 27 '16 at 18:27

2 Answers2

1

It is technically possible to use mycrypt functions in PHP 7, though it definitely has indeed been deprecated.

This answer may help you out: https://stackoverflow.com/a/35421763/5302315

The instructions are ubuntu-centric, but you should be able to work out the solution relatively simply if you're on another platform.

Community
  • 1
  • 1
chris g
  • 1,088
  • 10
  • 18
0

the webpage dosen't show mcrypt information

The PHP running inside your webserver and the PHP running from the command line share a lot of files - but not all. They may have been compiled to use different config files / different extension directories. Start by checking the location for the ini file reported by php -i at the command line and phpinfo() in a php generated web page.

symcbean
  • 47,736
  • 6
  • 59
  • 94