Jump to content
thirty bees forum

Update: juuri.no demo now on PHP 8.6 — patches and config shared on GitHub


Recommended Posts

Posted (edited)
Hi all,

Picking up where I left off in the performance testing thread: the juuri.no demo store that was running
thirty bees 1.7.0 on PHP 8.3 on an Orange Pi 5 has now been migrated to PHP 8.6.0 -- the latest PHP stable, 
released a week ago. The site is running clean (zero deprecations, zero warnings under load), 
still passing a perfect Lighthouse 100/100/100/100 on desktop, and the full upgrade process plus all 
patches are documented on GitHub:

https://github.com/petter5/orangepi5-config
What was needed to get thirty bees 1.7.0 running clean on PHP 8.6

Five small core/module patches (10-30 lines each), plus bumping Smarty and Guzzle to current versions. All patches are backwards compatible to PHP 7.4 -- i.e. safe to apply even if you stay on 8.3.

Core (thirtybees/thirtybees)

    classes/db/Db.php -- PHP 8.5 moved PDO::MYSQL_ATTR_* to the Pdo\Mysql namespace. 
The old constants trigger a deprecation on every DB connection. 
Patch uses class_exists('\Pdo\Mysql', false) so PHP 8.3 and older keep working with the old constants.
    classes/Dispatcher.php -- a $routeId variable could be null when used as an array offset. PHP 8.6 deprecates null array offsets. Fix moves the existing trim($routeId ?? '') line up before the isset check.
    classes/Customer.php -- same pattern in Customer::getGroupsStatic($idCustomer). Added a one-line $idCustomer = (int) $idCustomer at function entry.

Modules

    thirtybees/blockbestsellers -- three (double) casts replaced with (float). PHP 8.5 deprecated the (double) and (real) syntax.
    thirtybees/homeslider -- HomeSlide::__construct() had Context $context = null; PHP 8.4 deprecates implicit nullable, 
so changed to ?Context $context = null.

Niara theme -- WCAG accessibility fixes

    Newsletter input field had color: #777777 on #121212 background -- contrast 4.18:1, below WCAG AA (4.5:1). 
Bumped to #c8c8c8 (11.20:1, AAA), added explicit ::placeholder rule.
    Newsletter template used value="Enter your e-mail" as a pseudo-placeholder -- anti-pattern that both triggers the contrast check and sends the placeholder text as an actual email if the user doesn't clear the field. Switched to HTML5 placeholder attribute.
    Blog post cards on the homepage used <h5> directly after an <h2> section heading -- skipping h3 and h4, which fails WCAG 1.3.1 (info and relationships). Changed to <h3>.

Vendor bumps

Standard composer update operations against the existing TB composer config:

    smarty/smarty: 4.4.1 -> 4.6.0 (fixes template-injection CVE in the {extends} 
      cache path from 4.5.8, adds PHP 8.4-8.6 support)
    guzzlehttp/guzzle: 7.9.2 -> 7.17.0 (fixes 9 CVEs including host-bypass, cookie disclosure, 
      silent HTTPS-to-cleartext proxy downgrade)
    guzzlehttp/psr7: 2.7.0 -> 2.13.6 (fixes 4 CVEs including CRLF injection in start-line and URI host)

After the bumps: composer audit -> "No security vulnerability advisories found".
Verified clean on

    PHP 8.3.37 (previous production)
    PHP 8.4.28 (parallel test stack)
    PHP 8.6.0 (current production)

Test method: full crawl of 41 routes on each stack (home, categories, products, cart POST, admin login, API, contact form, etc.) with aggressive error_reporting, zero cache, and a warm 100-request parallel load test. 
      Under PHP 8.6 after patches: 0 deprecations, 0 warnings, 0 errors, 0 fatals.
Everything is on GitHub

The repo contains:

    patches/ -- 10 unified-diff patches, ready to git apply in each target thirty bees repo. 
      One PR per module/theme/core.
    thirtybees/themes/niara/ -- full drop-in file copies of the modified Niara theme files 
      for users who prefer s
      wapping files over patches.
    nginx/, php/, mariadb/, unattended-upgrades/ -- sanitized configuration templates. 
      Placeholders (example.com, yoursite) make them easy to adapt to any site.
    docs/deployment.md -- step-by-step for applying all of this to a standard thirty bees 
      installation (not just Orange Pi).

I'll be opening pull requests against the relevant thirty bees repos over the coming days, 
      one at a time. 
      If any maintainer wants to review or has concerns before I do, 
      grab me here or in the GitHub discussions on the orangepi5-config repo.
Still relevant from the original thread

    Orange Pi 5 (8GB NVMe, ~$80 hardware) peaks at ~93 000 req/sec through 
      nginx fastcgi_cache with wrk -t8 -c200 on juuri.no -- 
      details and benchmarks still accurate in nginx-thirtybees-oppsett.md.
    PHP-FPM worker count, OPcache size, MariaDB buffer pool tuning: all in the repo.
    CrowdSec + unattended-upgrades for security, Debian-security-only to avoid auto-restarting
      Immich/thirty bees stacks.

Happy to answer questions. 
      The best part of the move to 8.6 isn't the speed -- the site was already fast
      -- it's that the stack is now clean through the next major
      PHP release cycle (8.6 EOL is November 2029), with composer audit showing a clean bill of health.

Cheers,
Petter

 

Edited by Petter
formatting error

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...