Wordpress 无法识别来自 repos 的 Ubuntu 18.04 droplet 上的 PHP 更新(带有 PHP 7.4.3)。
它表明我有 PHP 版本 7。
如何让 WP 接受更新?
我的 .htaccess 中有这个
# END WordPress
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value memory_limit 400M
php_value max_execution_time 180
php_value max_input_time 180
# Wordfence WAF
<IfModule mod_php7.c>
php_value auto_prepend_file '/var/www/html/wordfence-waf.php'
</IfModule>
<Files ".user.ini">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</Files>
# END Wordfence WAF
WP_DEBUG true 不会产生任何错误
root@benja2:~# a2enmod php7.4
Considering dependency mpm_prefork for php7.4:
Considering conflict mpm_event for mpm_prefork:
Considering conflict mpm_worker for mpm_prefork:
Module mpm_prefork already enabled
Considering conflict php5 for php7.4:
Enabling module php7.4.
To activate the new configuration, you need to run:
systemctl restart apache2
root@benja2:~# systemctl restart apache2
root@benja2:~#
我的 wordfence-waf.php 中有这个
<?php
// Before removing this file, please verify the PHP ini setting `auto_prepend_file` does not point to this.
if (file_exists('/var/www/html/wp-content/plugins/wordfence /waf/bootstrap.php')) {
define("WFWAF_LOG_PATH", '/var/www/html/wp-content/wflogs/');
include_once '/var/www/html/wp-content/plugins/wordfence /waf/bootstrap.php';
}
?>
谢谢
答案1
禁用 php5 模块。
然后输入
sudo a2dismod php5.6 (old php version)
sudo a2enmod php7.4 (new php version)
现在再试一次。