[英]PHP uses a PHP.ini file that does not exist
I need to upgrade my PHP version in WordPress, but when I try, it still returns me the older version, even the folder does not exist.我需要在 WordPress 中升级我的 PHP 版本,但是当我尝试时,它仍然返回旧版本,甚至文件夹不存在。
You need to follow the below steps for updating:您需要按照以下步骤进行更新:
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
Open terminal and run the following commands to update Ubuntu packages.打开终端并运行以下命令来更新 Ubuntu 包。
sudo apt-get update
sudo apt install php7.4
Check php version
sudo php -v
PHP extensions are commonly used along with PHP. PHP 扩展通常与 PHP 一起使用。 Install them with the following command.
使用以下命令安装它们。
sudo apt install php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl -y
Next you need to disable your old PHP (say 7.0) and enable new PHP 7.4.接下来,您需要禁用旧的 PHP(比如 7.0)并启用新的 PHP 7.4。
sudo a2dismod php7.0
sudo a2enmod php7.4
sudo a2dismod php7.0
sudo a2enmod php7.4
Restart Apache web server to apply changes重启 Apache web 服务器以应用更改
sudo service apache2 restart
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.