← PHP and Laravel upgrades

Upgrade report: PHP 8.1 → 8.4.27, Laravel 9 → 13

Sample report for a fictional project. “Harbourline Bookings” does not exist. This shows what you receive at the end of an Advanced package: what was found, what changed, how it was tested, and what is left for you.

Application Harbourline Bookings (fictional): room and desk booking for a co-working company
Package Advanced: PHP + Laravel upgrade
Before PHP 8.1.29 (web), Laravel 9.52, 41 Composer packages, ~34k lines of PHP
After PHP 8.4.27 (web and CLI), Laravel 13, 38 Composer packages
Where Client’s own Ubuntu server, PHP-FPM behind nginx, queue workers under Supervisor
Worked on A copy of the repository and the client’s staging server; no production data
Result Test suite green (412 tests), staging deployed, client signed off on staging

1. What was checked first

  • The PHP that serves the site. php -v on the server said 8.3.4 (the command-line PHP), but the site’s health page reported 8.1.29: PHP-FPM still ran the old pool. The upgrade had to move FPM, the CLI and the queue workers together.
  • The October security release. PHP 8.1 gets no fixed release for the October 2026 vulnerabilities (CVE-2026-109618, CVE-2026-109619), so staying on 8.1 was not an option. The target was the fixed 8.4.27 release.
  • Framework support. Laravel 9 does not support PHP 8.4. Laravel 13 is supported until March 2028, so the framework moved four major versions, one at a time.
  • Packages. 41 Composer packages: 35 had versions for PHP 8.4 and Laravel 13, 3 were abandoned and had maintained replacements, 3 were no longer needed.

2. What changed

Framework, one major version at a time (9 → 10 → 11 → 12 → 13), with the full test suite after each step. Each step is a separate commit, so any one of them can be reviewed or reverted. The app moved to the slimmer Laravel 11+ skeleton (single bootstrap/app.php, middleware and exception handling there), keeping every route, middleware and scheduled job it had.

Deprecations fixed (PHP 8.2–8.4):

  • 14 dynamic properties declared on their classes;
  • 9 implicitly nullable parameters made explicit (?Type $x = null);
  • utf8_encode / utf8_decode replaced with mb_convert_encoding;
  • 6 string interpolations of the form "${var}" rewritten.

Package replacements:

Old Problem New
PDF generator (abandoned) no PHP 8.4 support maintained fork with the same API
Excel export (old major) Laravel 9 only current major; 2 export classes adjusted
Calendar widget package abandoned removed; 40 lines in a Blade component

Runtime. PHP 8.4.27 installed next to 8.1, a new FPM pool, nginx switched to it, queue workers restarted on the new binary, opcache settings carried over. Interim mitigation from the PHP project applied: session.upload_progress.enabled=0.

3. How it was tested

Check Result
Existing test suite (PHPUnit) 412 passed, 0 failed (was 398; 14 tests added for changed code)
Static analysis (PHPStan level 5) no new errors
Web runtime version on staging health page reports PHP 8.4.27
Queue workers jobs processed on 8.4.27 (worker log shows the version at start)
Manual walk-through on staging booking, cancellation, invoice PDF, Excel export, admin login: all worked
Error log after 24 h on staging no new warnings or deprecations

4. What is left for you

  • Production switch. The same steps as staging, in a 15-minute window; the runbook is in the repository (docs/upgrade-runbook.md) with the commands in order and a rollback: point nginx back at the 8.1 pool, which stays installed for one week.
  • Not part of this job: a security audit, checking whether the server was attacked before the patch, new features.
  • Next dates to know: PHP 8.4 gets security fixes until 31 December 2028; Laravel 13 until March 2028.

5. Time

Hours
Inventory and plan 2
Framework steps and deprecations 11
Package replacements 4
Runtime and staging deploy 2
Tests, walk-through, report 3
Total 22 (within the Advanced package’s 10-day delivery)