我已经使用 Google Cloud Platform (GCP) 一段时间了,现在我的大多数 WordPress 网站都出现错误,我需要更新我的 PHP
我用了
$ sudo apt install apt-transport-https lsb-release
$ sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg # Download the signing key
$ sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list' # Add Ondrej's repo to sources list.
$ sudo apt update
$ sudo apt-get install php7.3
To check the current version after the installation:
$ php -v
它有效
现在
$ php -v
显示这个
PHP 7.3.20-1+0~20200710.65+debian9~1.gbpc9cbeb (cli) (built: Jul 10 2020 07:22:47) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.20, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.20-1+0~20200710.65+debian9~1.gbpc9cbeb, Copyright (c) 1999-2018, by Zend Technologies
但是当我去我的WordPress时它仍然显示给我
Running PHP version: 7.0.33-29+0~20200514.36+debian9~1.gbp126f6f
我尝试了多种方法,但没有任何效果,例如
sudo update-alternatives --set php /usr/bin/php7.3
wp --info
现在它显示为
OS: Linux 4.9.0-12-amd64 #1 SMP Debian 4.9.210-1+deb9u1 (2020-06-07) x86_64
Shell: /bin/bash
PHP binary: /usr/bin/php7.3
PHP version: 7.3.20-1+0~20200710.65+debian9~1.gbpc9cbeb
php.ini used: /etc/php/7.3/cli/php.ini
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: /home/malriffaie
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.4.0
wordpress 仍然有同样的问题,我该怎么办?
aluckdog