I have a script that uses mcrypt_decrypt() function, but I get the following error
Fatal error: Call to undefined function mcrypt_decrypt()
What modules/libraries do I need to include to use this function? Or is there another reason I'm getting the error?
Thanks
Configure php5-mcrypt with php5-fpm (Ubuntu 14.04)
I’m going to assume you already have nginx and php-fpm installed and running.
php5-mcrypt should be installed already (it comes bundled with php5-fpm). Just for safety, apt-get install php5-mcrypt
Create symlink to mods-avaliable, ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini
Enable it. php5enmod mcrypt
Restart php-fpm, service php5-fpm restart
Restart nginx, service nginx restart
Done!
I upgraded PHP to 5.4 via http://php-osx.liip.ch/ and it worked.
From the manual:
Generally if PHP says a function is undefined, it means you need to compile in some library.
sudo apt-get install php5-mcrypt
works on ubuntu.
After upgrading to php 5.4 running (Works)
I above doesn't work, you can try this:
create mcrypt.ini file in /etc/php5/conf.d with content