Jeremy, seems to be this is an Ubuntu trusty packaging issue. I made some tests in a clean vagrant/trusty box:
$ sudo apt-get install -y php5-mcrypt php5-cli
$ dpkg -l | grep php5
ii php5-cli 5.5.9+dfsg-1ubuntu4.4 amd64 command-line interpreter for the php5 scripting language
ii php5-common 5.5.9+dfsg-1ubuntu4.4 amd64 Common files for packages built from the php5 source
ii php5-json 1.3.2-2build1 amd64 JSON module for php5
ii php5-mcrypt 5.4.6-0ubuntu5 amd64 MCrypt module for php5
ii php5-readline 5.5.9+dfsg-1ubuntu4.4 amd64 Readline module for php5
This small test program from php doc site also fail:
vagrant@vagrant-ubuntu-trusty-64:~$ cat test.php
<?php
$algorithms = mcrypt_list_algorithms("/usr/local/lib/libmcrypt");
foreach ($algorithms as $cipher) {
echo "$cipher<br />\n";
}
?>
vagrant@vagrant-ubuntu-trusty-64:~$ php test.php
PHP Fatal error: Call to undefined function mcrypt_list_algorithms() in /home/vagrant/test.php on line 2
vagrant@vagrant-ubuntu-trusty-64:~$
Jeremy, seems to be this is an Ubuntu trusty packaging issue. I made some tests in a clean vagrant/trusty box:
$ sudo apt-get install -y php5-mcrypt php5-cli 1ubuntu4. 4 amd64 command-line interpreter for the php5 scripting language 1ubuntu4. 4 amd64 Common files for packages built from the php5 source 1ubuntu4. 4 amd64 Readline module for php5
$ dpkg -l | grep php5
ii php5-cli 5.5.9+dfsg-
ii php5-common 5.5.9+dfsg-
ii php5-json 1.3.2-2build1 amd64 JSON module for php5
ii php5-mcrypt 5.4.6-0ubuntu5 amd64 MCrypt module for php5
ii php5-readline 5.5.9+dfsg-
This small test program from php doc site also fail: vagrant- ubuntu- trusty- 64:~$ cat test.php list_algorithms ("/usr/ local/lib/ libmcrypt" );
vagrant@
<?php
$algorithms = mcrypt_
foreach ($algorithms as $cipher) { vagrant- ubuntu- trusty- 64:~$ php test.php list_algorithms () in /home/vagrant/ test.php on line 2 vagrant- ubuntu- trusty- 64:~$
echo "$cipher<br />\n";
}
?>
vagrant@
PHP Fatal error: Call to undefined function mcrypt_
vagrant@
Related upstream ubuntu bugs: /bugs.launchpad .net/ubuntu/ +source/ php5-mcrypt/ +bug/1261655
Incorrect installation directory in Trusty
https:/
put ini in correct path /bugs.launchpad .net/ubuntu/ +source/ php-mcrypt/ +bug/1243568
https:/
So after manual creation of the missing symlink the test php runs well. mods-available/ mcrypt. ini /etc/php5/ cli/conf. d/
$ ln -s /etc/php5/
The package version number seems strange also php5-mcrypt 5.4.6 vs. php5-cli 5.5.9.