我正在使用 Ubuntu 22.04 和一个需要 PHP 5.6 的网站。但在安装网站脚本时出现错误:
mcrypt is not enabled on your web hosting account
为了安装mcrypt
,我使用了:
sudo apt install php5.6-mcrypt
但在 php 信息中它没有启用。我尝试过phpenmod mcrypt
,并且收到类似以下的警告:
WARNING: Module mcrypt ini file doesn't exist under /etc/php/8.2/mods-available
WARNING: Module mcrypt ini file doesn't exist under /etc/php/8.0/mods-available
我尚未在这些版本的 PHP 上安装 mcrypt,因此不需要它们。
然而,似乎没有什么能让 php5.6 mcrypt 启动。
我尝试将下面的行添加到其中,php.ini
但这又不能解决问题。
extension=mcrypt.so
extension=php_mcrypt.dll
关于如何让 mcrypt 适用于 php5.6 的任何想法。
我正在使用php5.6-fpm
并将其添加到虚拟主机中,以便为 sdomain 加载 php5.6。
附加信息:
inkspot@vps:~$ sudo apt install php5.6-mcrypt
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
php5.6-mcrypt is already the newest version (5.6.40-68+ubuntu22.04.1+deb.sury.or g+1).
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
inkspot@vps:~$ sudo a2enmod proxy_fcgi
Considering dependency proxy for proxy_fcgi:
Module proxy already enabled
Module proxy_fcgi already enabled
inkspot@vps:~$ sudo a2enmod setenvif
Module setenvif already enabled
inkspot@vps:~$ sudo a2enconf php5.6-fpm
Enabling conf php5.6-fpm.
To activate the new configuration, you need to run:
systemctl reload apache2
inkspot@vps:~$ sudo phpenmod mcrypt
WARNING: Module mcrypt ini file doesn't exist under /etc/php/8.2/mods-available
WARNING: Module mcrypt ini file doesn't exist under /etc/php/8.2/mods-available
WARNING: Module mcrypt ini file doesn't exist under /etc/php/8.2/mods-available
WARNING: Module mcrypt ini file doesn't exist under /etc/php/8.1/mods-available
WARNING: Module mcrypt ini file doesn't exist under /etc/php/8.1/mods-available
WARNING: Module mcrypt ini file doesn't exist under /etc/php/8.1/mods-available
inkspot@vps:~$ sudo service apache2 restart
inkspot@vps:~$ sudo service php5.6-fpm restart
inkspot@vps:~$
这是以下结果: sudo apache2ctl -M
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
expires_module (shared)
fcgid_module (shared)
filter_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
php_module (shared)
proxy_module (shared)
proxy_fcgi_module (shared)
reqtimeout_module (shared)
rewrite_module (shared)
security2_module (shared)
setenvif_module (shared)
socache_shmcb_module (shared)
ssl_module (shared)
status_module (shared)
unique_id_module (shared)