DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
VGSources
Blog

How to Upgrade PHP for Nextcloud Without Breaking Your Install

A practical, release-aware guide to changing PHP and upgrading Nextcloud without breaking code, apps, migrations or user data.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Upgrade PHP only after you have identified your exact Nextcloud release and installation method. Choose a PHP version supported by both the release you run and the next release you plan to install, make a restorable backup, place Nextcloud in maintenance mode, change the web and command-line PHP runtimes together, and upgrade one Nextcloud major version at a time. Never attempt an in-place downgrade if something fails; restore into a fresh installation instead.

Start with the two facts that determine every safe upgrade

Find the exact Nextcloud release

Compatibility is tied to the Nextcloud major release, not merely to the PHP version already installed on the server. Read the version shown in the Administration overview, or run occ status from the Nextcloud directory as the web-server user. Record the complete version, including its major and point numbers, before changing PHP.

As an Amazon Associate I earn from qualifying purchases.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The current system-requirements documentation lists PHP 8.3, 8.4 and 8.5, with PHP 8.5 recommended for the current documentation set (accessed October 15, 2026). That page is not a substitute for the release matrix when you run an older Nextcloud branch. The matrix edited September 1, 2026 is the authority for those older branches.

Identify how Nextcloud was installed

The commands in this guide assume a conventional archive installation on Linux. A Snap, Docker container, pre-built virtual machine, or operating-system package has a different PHP lifecycle and an authoritative updater supplied by that distribution point. Changing host PHP packages will not necessarily change the PHP runtime inside a container or appliance.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.
  • Archive installation: you control the files, web server, PHP integration and occ commands directly.
  • Snap: follow the Snap publisher’s refresh and rollback procedure rather than replacing host PHP packages.
  • Docker: change the image or compose configuration and recreate the container; do not modify a host PHP installation expecting the container to change.
  • Virtual machine or appliance: use the image vendor’s documented update path and snapshot or backup process.
  • Distribution package: use the package maintainer’s Nextcloud and PHP update instructions, including its service names and configuration layout.

If you cannot state both the installed Nextcloud release and the installation method, stop here. Guessing at either one is the most common way to select an unsupported PHP runtime.

PHP compatibility matrix by Nextcloud release

The following ranges come from the Nextcloud project’s maintained PHP-version matrix, edited September 1, 2026. A range means the listed PHP minor versions are supported for that Nextcloud major release; it does not promise that every operating-system package, extension or third-party app is compatible.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Nextcloud release Supported PHP versions
35 8.3, 8.4, 8.5
34 and 33 8.2–8.5
32 and 31 8.1–8.4
30 8.1–8.3
29 and 28 8.0–8.3
27 and 26 8.0–8.2
25 and 24 7.4, 8.0, 8.1
23, 22 and 21 7.3, 7.4, 8.0
20, 19 and 18 7.2–7.4
17 and 16 7.1–7.3
15 7.0–7.3
14 7.0–7.2
13 5.6, 7.0–7.2
12 and 11 5.6, 7.0, 7.1
10 5.4–5.6 and 7.0

For example, moving a Nextcloud 32 server directly to PHP 8.5 is not supported by this matrix. You must first move Nextcloud through releases until the target release supports PHP 8.5, or choose an interim PHP version supported by both the current and immediate target releases.

Keeping PHP current matters because obsolete PHP branches no longer receive security fixes and restrict the language features available to Nextcloud and its packages. Newer supported PHP branches can also improve performance, but compatibility and security come before any perceived speed gain.

Plan the release path before changing PHP

Use overlapping support, not the newest number by default

Write down three values: your current Nextcloud major release, the next major release you intend to install, and the PHP version you want to run afterward. Select a PHP version that appears in both releases’ rows in the matrix. If there is no overlap, upgrade Nextcloud first using a PHP version supported by the current release, then continue one major release at a time until the desired PHP version becomes valid.

Upgrade point releases first

Before every major-version hop, bring the currently installed major release to its latest available point release. Point releases contain fixes and migration preparation that the next major upgrade expects. Do not skip a major release: Nextcloud’s Administration Manual explicitly requires step-by-step upgrades.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Allow migrations to finish

After each major upgrade, leave the server running and let scheduled background work complete before beginning the next hop. The upgrade manual gives two or three cron.php runs as an example. Large databases or file collections may require substantially longer; watch the Administration page and cron status rather than starting the next upgrade immediately after the first successful command.

Back up and prepare applications

Make a fresh, restorable backup immediately before every PHP or Nextcloud change. A backup that has never been restored is only an assumption, so verify that you can read the database dump and retrieve files from the data backup.

  • Database: create a consistent dump using the database engine’s supported backup method.
  • Data directory: include user files, versions, trash, and any externally mounted storage that is part of the deployment.
  • config/config.php: preserve database credentials, trusted domains, paths, salts and other local settings.

Read the target release’s critical-change notes. Review every third-party app and theme for support for both the target Nextcloud release and the PHP version. Disable third-party apps before the change, then re-enable them individually only after the core installation works. An app can fail even when Nextcloud itself passes its requirements check.

Put an archive installation into maintenance mode

The built-in updater enables maintenance mode automatically. For a manual PHP change or manual archive upgrade, enable it yourself from the Nextcloud installation directory:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo -E -u www-data php occ maintenance:mode --on

Replace www-data if your web server uses a different account. Maintenance mode locks existing sessions and prevents new logins, so users cannot write data while code, PHP modules or database schemas are changing. Keep it enabled through the runtime switch, upgrade command and initial checks.

After verification succeeds, disable it with:

sudo -E -u www-data php occ maintenance:mode --off

If the command reports that occ cannot run, do not keep retrying with a random PHP binary. Confirm the installation directory, file ownership and the CLI PHP version first.

Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

Change PHP without creating a web/CLI mismatch

Install the supported runtime and extensions

Use the operating system’s normal package or image procedure to install a PHP minor version listed for both your current and immediate target Nextcloud releases. The documentation does not prescribe one universal package command: service names, repositories and extension packages differ among Linux distributions, containers and appliances.

Keep the extensions required by your deployment, including the database driver, XML, multibyte-string, GD or image-processing support, archive handling, internationalization and the modules required by enabled apps. Compare the enabled-module list before and after the switch instead of assuming a new PHP package copied every module.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Switch the web process and the command line

Nextcloud receives web requests through Apache’s PHP module or through PHP-FPM behind a web server. The php executable used for occ is a separate selection on many systems. Both must point to the same supported PHP branch, or you can see a healthy command-line check while the browser still runs an old interpreter (or the reverse).

  1. Record the current CLI result with php -v and the enabled modules with php -m.
  2. Change the Apache PHP module or the PHP-FPM pool used by the Nextcloud virtual host, according to your operating system’s documented procedure.
  3. Restart or reload the relevant PHP-FPM and web-server services using the operating system’s normal service mechanism.
  4. Run php -v again as the account that will execute occ, and confirm that it reports the intended minor version.
  5. Check the Administration overview after the web process is back; it must report the same supported PHP branch.

Do not mix a new PHP-FPM socket with an old pool configuration, and do not remove the old runtime until the web server, cron jobs and occ all work with the replacement. Keep the old package available during the validation window so you can return the service to the previous runtime without changing the Nextcloud database.

Upgrade Nextcloud after PHP is ready

Built-in updater

For most archive-based environments, the built-in updater is the easiest path. It handles maintenance mode and presents the release transition in the Administration interface. It still requires the backup, app review, supported PHP overlap and sequential-major rules described above. Follow the updater’s prompts, wait for it to finish, and do not refresh the browser repeatedly during a long migration.

Manual archive upgrade

Use the manual route when your deployment needs explicit file, service or timing control. The procedure below is intentionally generic because package and service commands vary by operating system.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
  1. Complete the backup and third-party-app checks, then enable maintenance mode.
  2. Download the target Nextcloud archive outside the current installation directory and verify its integrity using the project’s published verification method.
  3. Stop the web server and the Nextcloud cron job so no request or background task writes while the code is replaced.
  4. Move the existing code directory aside or otherwise preserve it, then unpack the new release in its place.
  5. Restore config/config.php and preserve the data directory; never overwrite user data with the archive’s empty data path.
  6. Restore the ownership and permissions expected by the web-server account.
  7. Start the web server, change into the Nextcloud installation directory, and run the database and code migrations:
sudo -u www-data php occ upgrade
  1. Re-enable the Nextcloud cron job and let scheduled background work run before the next major-version hop.
  2. Leave maintenance mode enabled until the checks in the next section pass.

Run the command from inside the Nextcloud installation directory. If your web account is not www-data, substitute the account that owns the installation and normally serves requests.

Complete migrations and verify the result

After a major upgrade, the Administration setup checks may identify database work that should be run manually. These commands can preview the SQL with --dry-run before making changes:

sudo -u www-data php occ db:add-missing-columns
sudo -u www-data php occ db:add-missing-indices
sudo -u www-data php occ db:add-missing-primary-keys

Use the preview option first when you need to understand the proposed operations, and make sure the database backup remains available before applying them.

Work through this validation list while maintenance mode is still on:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Confirm the displayed Nextcloud version is the intended point release.
  • Confirm the PHP version in the Administration overview and from the CLI used to run occ.
  • Test a real login, file listing, upload, download and deletion with a test account.
  • Confirm that scheduled cron execution is running and that background migrations are progressing.
  • Check database connectivity, storage availability and the Administration health warnings.
  • Open core apps, then re-enable and test each third-party app one at a time.
  • Review the web-server and PHP-FPM logs for errors generated during the first requests.

Only after these checks pass should you run maintenance:mode --off and return the service to users. Keep watching the logs and cron status during the first normal operating period; an app may execute a code path that a simple login does not exercise.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What to do when an upgrade stalls or maintenance mode remains on

Web updater timed out

A web upgrade can appear frozen when a PHP execution timeout ends the browser request while the migration continues or stops. Do not start a second web upgrade. From the installation directory, keep users out of the system and run:

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.
sudo -u www-data php occ upgrade

If the migration still does not complete, try:

sudo -u www-data php occ maintenance:repair

Read the command output and server logs before making another change. A repair command is not a license to skip a failed database backup or to remove tables manually.

Maintenance mode is still enabled after a successful check

Verify the version, PHP runtime, login test, storage and cron checks first. Then disable the mode explicitly:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo -E -u www-data php occ maintenance:mode --off

If the command cannot run, use the same PHP binary and web account that successfully ran the upgrade, correct the path or permissions, and retry. Do not edit the database’s configuration rows by hand.

Never downgrade the existing installation to recover

Nextcloud states that downgrading is unsupported and risks corrupting data. Replacing newer code with an older release against the already-migrated database can leave schemas, file metadata and app data in an inconsistent state.

When recovery is necessary, build a fresh installation at the desired supported version. Restore the known-good database, data directory and config/config.php backup into that clean environment, then validate the PHP runtime, trusted domains, storage mounts and apps before exposing it to users. This takes longer than an in-place downgrade but preserves a defensible recovery path.

Choose an upgrade approach that matches your deployment

Approach Control over PHP and files Typical downtime and risk Use it when
Built-in updater on an archive install Moderate; the updater controls code replacement while you control the host Maintenance mode lasts through migrations; app compatibility remains the main risk You want the simplest supported archive workflow
Manual archive replacement High; you schedule services, files, permissions and CLI migrations Downtime is deliberate and can be lengthy on large databases You need change-window control, scripted checks or unusual web-server integration
Snap, Docker, virtual machine or package deployment Defined by the publisher’s image or package lifecycle Host-level PHP changes may have no effect; using the wrong procedure can leave components mismatched You can follow that distribution point’s documented updater and backup process

Regardless of approach, the rollback posture is the same: restore a known-good backup rather than downgrading the live database. The PHP path is safe only when the selected runtime is supported by both the current release and the next release in the sequence.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When paid support is worth considering

Organisations that cannot tolerate a long recovery window may prefer Nextcloud’s own premium or enterprise support. Its current requirements documentation describes an option with five years of long-term support covering high and critical security issues, data-loss fixes and regressions. Availability, terms and geography can change, so confirm the current offer directly with Nextcloud before relying on it for a support commitment.

For a self-managed server, the same operational discipline still applies: document the installation method, maintain tested backups, rehearse a restore and schedule upgrades with enough time for migrations and app testing.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.