Ubuntu Server 从20.04升级到22.04

先更新一下包再重启一下

apt update
apt upgrade
reboot

然后升级系统

do-release-upgrade -d

升级过程中有要确认的选项直接默认回车就行了,大概十分钟就升级完成了

Ubuntu 22.04 升级到PHP8了,所以要改一下nginx的配置文件,把原来的7.4改成8.1,这样网站才能正常运行

fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;

打开网站后,WordPress会显示很多已弃用的警告,关闭debug就不会显示了,这些警告不会影响到网站

Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in .../wp-content/plugins/wordpress-seo/src/integrations/admin/helpscout-beacon.php on line 108
Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in .../wp-content/plugins/wordpress-seo/src/conditionals/third-party/elementor-edit-conditional.php on line 22
Deprecated: Constant FILTER_SANITIZE_STRING is deprecated in .../wp-content/plugins/wordpress-seo/src/conditionals/third-party/elementor-edit-conditional.php on line 28
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in .../wp-includes/functions.php on line 7035
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in .../wp-includes/functions.php on line 2164
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in .../wp-includes/functions.php on line 7035
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in .../wp-includes/functions.php on line 2164
null to parameter #1 ($string) of type string is deprecated in .../wp-includes/formatting.php on line 2772

wp-config.php文件里关掉debug就不会显示了

define( 'WP_DEBUG', false ); 

我在Piwigo里,也会显示出相同的警告,编辑local/config/config.inc.php文件,加入下面的代码也可以关掉已弃用警告

$conf['show_php_errors'] = E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING;