update php to 8.0 apach

שיתוף ב facebook
שיתוף ב twitter
שיתוף ב pinterest

Update WordPress PHP in Apache

To update PHP in Apache, first let’s add the PHP repository to the system

curl -sSL https://packages.sury.org/php/README.txt | sudo bash -x

In addition to installing a specific version of PHP (version 8.0 in this case), let’s install some PHP modules that WordPress may or may not need depending on what plugins you have installed.apt install php8.0apt install php8.0-bz2 php8.0-cli php8.0-common php8.0-curl php8.0-gd php8.0-gmp php8.0-intl php8.0-mbstring php8.0-mysql php8.0-opcache php8.0-pspell php8.0-readline php8.0-soap php8.0-tidy php8.0-xml php8.0-xmlrpc php8.0-zip

Finally let’s tell the Apache web server to use the new version of PHP instead of the old one

.a2dismod php7.4a2enmod php8.0systemctl restart apache2

At this point, you can verify that WordPress is now using a new version of PHP.

Update WordPress PHP in Nginx

To update PHP in Nginx, first let’s add the PHP repository to the system.apt updateapt install software-properties-commonadd-apt-repository ppa:ondrej/php

In addition to installing a specific version of PHP (version 8.0 in this case), let’s install some PHP modules that WordPress may or may not need depending on what plugins you have installed.apt install php8.0apt install php8.0-fpm php8.0-bz2 php8.0-curl php8.0-gd php8.0-gmp php8.0-intl php8.0-mbstring php8.0-mysql php8.0-pspell php8.0-soap php8.0-tidy php8.0-xml php8.0-xmlrpc php8.0-zip

Finally let’s tell the Nginx web server to use the new version of PHP instead of the old one. To do this, edit your website’s configuration file which is usually location at /etc/nginx/sites-available/. Simply update the php-fpm socket reference (assuming you’re using that) to the new version of PHP. The line will look something like this server unix:/var/run/php/php8.0-fpm.sock.

To apply this change, reload the Nginx web server.

שתפו עם חברים שלכם

שיתוף ב facebook
שיתוף ב google
שיתוף ב twitter
שיתוף ב linkedin
פתח צ'ט
?צריכים עזרה
?היי, אפשר לעזור