![无法加载动态库](https://linux22.com/image/540843/%E6%97%A0%E6%B3%95%E5%8A%A0%E8%BD%BD%E5%8A%A8%E6%80%81%E5%BA%93.png)
当我运行 php -v 时出现此错误:
PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/php_mcrypt.dll' - /usr/lib64/php/modules/php_mcrypt.dll: cannot open shared object file: No such file or directory in Unknown on line 0
我怎样才能解决这个问题?
答案1
验证mcrypt.so是否存在:
file /usr/lib64/php/modules/mcrypt.so
然后更改 php.ini 行:
extension=php_mcrypt.dll
到:
extension=mcrypt.so
如果不存在,请安装 libmcrypt 和 php-mcrypt:
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/libmcrypt-2.5.7.tar.gz
rpmbuild -ta libmcrypt-2.5.7.tar.gz
rpm -ivh /usr/src/redhat/RPMS/i386/libmcrypt-2.5.7-1.i386.rpm /usr/src/redhat/RPMS/i386/libmcrypt-devel-2.5.7-1.i386.rpm
yum --enablerepo=centosplus install php-mcrypt
我建议使用 Ubuntu,因为它可以轻松安装 PHP、PHP 模块和 Web 服务器。Ubuntu 存储库包含更多软件包,您无需连接其他存储库并编译应用程序。