Tag: php

  • Critical PHP Vulnerability: What WordPress Owners Need to Do

    Critical PHP Vulnerability: What WordPress Owners Need to Do

    What happened?

    Introduction

    On 21 October 2026, the PHP team released urgent fixes for two critical vulnerabilities, CVE-2026-109618 and CVE-2026-109619. Both could let an attacker run harmful code on a server without logging in. The PHP team advises updating immediately. (PHP advisory)

    If your WordPress site runs on a DigitalOcean server or droplets, it could be at risk until PHP is updated.

    Why it matters

    Think of WordPress as a shop and PHP as the worker who handles every customer request. The flaw is in that worker, not in the shop. An attacker could send specially crafted requests that trick the server into running their instructions.

    If exploited, the possible results include:

    • The site going down or behaving incorrectly
    • Unauthorised access to the server
    • Exposure of data stored on the server
    • Changed files or the server being used for other attacks

    These are possible outcomes, not proof that your site has been attacked.

    WordPress itself is not broken. This is a PHP issue, so no separate WordPress update is needed to fix it. Keep WordPress, themes and plugins updated anyway. (WordPress announcement)

    Which versions are affected

    • Fixed: PHP 8.2, 8.3, 8.4 and 8.5 receive the patches.
    • Not fixed: PHP 8.1 and earlier are no longer supported and will not get these fixes from the PHP project.

    What to do

    If a developer or hosting company manages your server, send them these steps. Otherwise, follow them yourself.

    1. Back up first. Take a DigitalOcean snapshot of your Droplet, plus a recent backup of your WordPress files and database. This gives you a way back if something goes wrong.
    2. Check your PHP version. In WordPress, go to Tools → Site Health → Info → Server and note the PHP version. If it is 8.1 or older, updating Ubuntu will not solve the problem. You will need to move to a supported version (see below).
    3. Install the security update. Ubuntu 24.04 uses PHP 8.3 by default, and Ubuntu released its own fix on 21 October 2026 (notice USN-8948-1). Apply the available system updates, and review what will change before confirming. Ubuntu’s version numbers may differ from PHP’s own, so check the Ubuntu notice rather than the version number alone. If you installed PHP from a third-party repository, check that source for the fix instead.
    4. Restart the PHP service. The update only takes effect once the service your site actually uses (PHP-FPM or Apache) has restarted. Expect a brief interruption.
    5. Test your site. Check that key pages load, you can log in to the dashboard, and forms or payments work. Then recheck the PHP version in Site Health.

    If you cannot confirm that the PHP serving your site has the fix, assume it is still vulnerable and ask your administrator to verify.

    If you run PHP 8.1 or older

    Plan an upgrade to a supported PHP version. Test your themes and plugins for compatibility first, and keep your backup ready, because older plugins can break on newer PHP.

    *You may try to upgrade your ubuntu core accordingly which will upgrade your php version. However you must follow the step by step guide to upgrade ubuntu from version 18 to 20, then to 22, 24 and lastly 26. as you upgrade your ubuntu version, each version will carry a updated php version with the software.

    Why act now

    Once flaws become public, attackers scan websites automatically. Small sites are targeted too. A site can look normal while still running vulnerable software, so don’t wait for visible problems.

    Updating PHP is a key step, but it doesn’t replace regular maintenance of WordPress, plugins, server settings and backups.

    References

    This is general guidance. Server setups differ, so confirm which PHP installation your site uses before making changes.

  • Upgrading an Outdated Ubuntu VPS: The Step-by-Step Guide

    Upgrading an Outdated Ubuntu VPS: The Step-by-Step Guide

    Learn how to safely upgrade your server OS, PHP, and MySQL database without breaking your website.

    Upgrading an outdated server (Virtual Private Server) can feel intimidating, but if you follow the right sequence, you won’t crash your website or lose your data.

    Think of your VPS like a house:

    • Ubuntu is the foundation and walls.
    • PHP is the plumbing and electricity.
    • MySQL is the fragile filing cabinet storing all your precious data.

    If you try to move the filing cabinet while breaking down walls, everything will shatter. That is why the order of operations is critical.


    The Golden Rule: OS & PHP First, MySQL Second

    Always upgrade your operating system and web scripting environment first, while keeping your database untouched. Once the house is structurally stable on the newest version, you upgrade the database step-by-step.

    [Phase 1: Foundation]               [Phase 2: Database]
    Ubuntu 20.04 (PHP 7.4)             MySQL 5.7
              ↓                                 ↓
    Ubuntu 22.04 (PHP 8.1/8.3)         MySQL 8.0
              ↓                                 ↓
    Ubuntu 26.04 (PHP 8.3)             MySQL 8.4 → 9.3 → 9.7

    Step-by-Step Upgrade Process

    Step 1: Take a Full Server Snapshot (Backup)

    Crucial prerequisite before running any terminal commands

    Before typing a single command, log in to your VPS provider dashboard (DigitalOcean, AWS, Linode, etc.) and create a full Snapshot / Backup. If anything breaks during the upgrade, you can restore your entire server with one click.

    Step 2: Upgrade Ubuntu OS & PHP (20.04 LTS → 22.04 LTS → 26.04 LTS)

    Do not touch or upgrade MySQL during this phase

    Update your current packages first, then upgrade the operating system release by release. Never skip LTS versions.

    1. Update current packages:
      sudo apt update && sudo apt dist-upgrade -y
    2. Upgrade Ubuntu 20.04 LTS to 22.04 LTS:
      sudo do-release-upgrade
    3. Install PHP 8.3:
      sudo add-apt-repository ppa:ondrej/php -y
      sudo apt update
      sudo apt install php8.3 php8.3-cli php8.3-fpm php8.3-mysql -y
    4. Upgrade to the next LTS version (24.04 / 26.04 LTS):
      Repeat sudo do-release-upgrade to move to the next long-term support release while keeping PHP configured at 8.3.

    Step 3: Verify PHP and Web Services

    Ensure your websites can run on PHP 8.3

    Check that PHP is running correctly on version 8.3:

    php -v

    Ensure your web server (Nginx or Apache) points to the new php8.3-fpm socket and that your websites load properly before touching the database.

    Step 4: Upgrade MySQL via the Sequential Version Path

    Path: 5.7 → 8.0 → 8.4 → 9.3 → 9.7

    Major MySQL updates change how data is stored. You cannot jump directly from 5.7 to 9.x; doing so will corrupt your tables. You must step through each major milestone:

    • Step 4A: MySQL 5.7 → 8.0
      Run the MySQL shell upgrade checker to verify syntax compatibility, then upgrade packages to 8.0.
    • Step 4B: MySQL 8.0 → 8.4 LTS
      Upgrade to 8.4 (the Long Term Support release for MySQL 8).
    • Step 4C: MySQL 8.4 → 9.3 Innovation Release
      Transition into the MySQL 9.x series.
    • Step 4D: MySQL 9.3 → 9.7
      Finalize the upgrade to version 9.7.

    After each MySQL step, run the system status check to verify database health:

    sudo systemctl status mysql

    Key Takeaways for Beginners

    1. Never jump OS or Database major versions. Moving incrementally (20.04 → 22.04 → 26.04 for OS; 5.7 → 8.0 → 8.4 for MySQL) ensures automatic data migration scripts run smoothly.
    2. Freeze database changes while upgrading. Do not make major database updates at the same time you are updating OS libraries.
    3. Always test PHP compatibility. PHP 7.4 code often uses functions deprecated in PHP 8.3, so ensure your website scripts (like WordPress plugins or themes) are updated to support PHP 8.3.