How can I savely upgrade my wordpress from php 7.2 to above?

0

Hi Community,

I need a higher php version, for some pluigins. I have installed wordpress with these two instrucitons: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-lamp-amazon-linux-2.html https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html How can I safely upgrade it to a highr php version :)? And which php version would you recommend? my site: http://www.darm-fit.at

nice regards sebastian

profile picture
질문됨 8달 전233회 조회
1개 답변
0
수락된 답변

Amazon Linux 2 (AL 2) will EOL (end-of-life) June 2025, so you may want to use Amazon Linux 2023 which will EOL 2028

You can use amazon-linux-extras to install PHP 8.1 or PHP 8.2. Something like below. You will need to run the commands as root

              amazon-linux-extras enable php8.2
              yum clean metadata
              yum install -q -y php-{cli,fpm,opcache}
              yum install -q -y php-{mysqlnd,pgsql,pdo,dba}
              yum install -q -y php-{xml,soap,ldap,intl}
              yum install -q -y php-{mbstring,bcmath,gd,enchant,pspell,tidy}

You will need to remove existing PHP versions first.

I would suggest latest PHP version 8.2 due to long EOL date Note that you will need to compile/install other PHP extensions such as php-redis and php-imagick yourself.

Alternatively, you can also use ec2-lamp-server CloudFormation template, to provision a new EC2 AL2 or AL2023 LEMP instance with additional PHP extensions, and install WordPress, and migrate your website.

Here are my WordPress on AL2023 install notes for your reference with Nginx and MariaDB

MariaDB (root password not needed as this is named pipes)

sudo mysql -uroot -p


CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER wordpress@localhost IDENTIFIED BY 'yourpassword';
GRANT ALL on wordpress.* to wordpress@localhost;
quit

Create DNS entry, run certbot

sudo certbot --nginx

WordPress install files on Nginx

cd /tmp/
wget https://wordpress.org/latest.zip
unzip -q latest.zip
sudo cp -R wordpress/* /usr/share/nginx/html/
sudo chown -R apache:apache /usr/share/nginx/html/
AWS
전문가
Mike_L
답변함 8달 전
  • Thank you very much. This is the answer I searched for :- ). Nice regards sebastian

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠