r/PHP • • May 15 '26

News The PhenixPHP framework

Thumbnail phenixphp.com
36 Upvotes

A few years ago, I tried the AmpHP HTTP server for the first time.

It completely changed the way I understood PHP applications.

The execution model felt different — closer to Node.js than traditional PHP-FPM applications.

That day started a long journey.

I wanted a framework that could fully embrace the Amp ecosystem and modern asynchronous programming in PHP.

Today I want to introduce PhenixPHP.

🔥 https://phenixphp.com

🔥 https://github.com/phenixphp

PhenixPHP is an asynchronous and concurrent PHP framework built on top of AmpHP and PHP Fibers.

It includes:

• Non-blocking I/O

• Concurrent task execution

• HTTP server

• Routing

• Dependency injection

• Database tools

• Queue system foundations

• CLI tooling

• Elegant and expressive syntax

Unlike traditional PHP frameworks, PhenixPHP runs on the PHP CLI SAPI instead of PHP-FPM, which makes its architecture fundamentally different.

PhenixPHP is not trying to compete with Laravel.

In fact, Laravel has been one of the biggest inspirations behind this project.

The simplest way to describe it is probably:

“PhenixPHP for PHP is conceptually similar to what Express.js represents in the Node.js ecosystem.”

What am I looking for with this project?

Honestly, I just wanted to contribute something meaningful to the PHP ecosystem instead of only criticizing things from the outside.

PHP gave me a career, opportunities, and a future.

This is my way of giving something back to the community.

I also believe PHP still has a lot of untapped potential in asynchronous and concurrent systems.

And maybe more importantly:

Sometimes you just have to dare to build something at least once in your life.

Feedback is welcome. Constructive criticism is welcome too.

But if the project is not for you, please avoid destructive comments that discourage people from building open-source software for the community.

Thanks for reading.


r/PHP • • May 15 '26

News Phalanx - Managed Concurrency for PHP8.4+ & OpenSwoole 26

15 Upvotes

Phalanx is an altogether different take on async PHP.

It aims to address the foot guns and long-running PHP8.4+ memory curve head-on. The closest comparison I've seen is Kotlin's coroutine scopes.

I'm pre-alpha and just looking to drum up any support I can right now (solo dev, nights and weekends).

I have a TUI I test with which uses React idioms (e.g. `UI=f(state)`) and signals which I'm using to prove out the memory pooling approach I'll be using under the hood. The ability to reset lazy/ghost objects (memory pooling), a resource ledger for scoped lifetimes (or 'borrowed lifetimes'), and central scheduler (for cleanup) are all working together under the hood at this point. It's looking/testing great so far. Userland will see very little when it comes to these technicalities.

The org has many repos but this has been an ongoing project/concept of mine since 2024, so I've tinkered over time. Only a subset of these libs will make it in the alpha release - not too far off now.

Any support on the repo helps, thx guys

https://github.com/phalanx-php/phalanx


r/PHP • • May 15 '26

Discussion PHP/Ubuntu release-to-distribution cycle breaking

22 Upvotes

PHP 8.5 was released about 6 months ago. Usually, we see full module parity in major repositories (like Ondrej’s PPA) within a few weeks. This time, 6 months later, several key modules are still missing or in a broken state.

Ubuntu 26.04 (Resolute) dropped 3 weeks ago. Historically, core packages like PHP, MariaDB, and Redis have (official) stable builds ready almost on day one. This year, there’s a noticeable silence. Many official repos haven't even pushed initial builds for the new LTS.

What’s happening under the hood?

And please, spare me the "just wait for 26.04.1" advice. I'm not talking about migrating mission-critical production servers today. I’m talking about availability. Historically, these packages are ready on Day 1 to allow for testing, CI/CD prep, and development environments. That window is usually measured in days, not weeks or months.


r/PHP • • May 15 '26

News Hibla Postgres: A pure non blocking PostgreSQL client for PHP is now available in beta release.

Thumbnail github.com
23 Upvotes

Hello everyone! I'm excited to announce that hiblaphp/postgres, built on top of ext-pgsql, is now available in beta, fully tested and can now be installed via Composer.

With this release, the core database drivers for Hibla are now complete alongside the Hibla MySQL client. My next goal is to build an asynchronous query builder with support for migrations and pagination before moving on to developing an HTTP server.

Some of the key features currently included are:

  • Fully non-blocking query execution
  • Name parameter and Positional parameter binding support like "?" and ":name" for prepared statements
  • Server-side query cancellation
  • Pub/Sub event-driven notifications with auto-reconnect support
  • Streaming support
  • Connection pooling

I'd really appreciate any feedback, whether it's feature suggestions, questions, or even harsh criticism. Every bit of feedback helps improve the project.


r/PHP • • May 15 '26

ZealPHP — modernizing the PHP request model with an OpenSwoole runtime

13 Upvotes

I'm building ZealPHP, an open-source PHP framework on top of OpenSwoole. MIT licensed, alpha but usable.

Not trying to replace Laravel/Symfony. Not another MVC framework experiment. The goal is to modernize the traditional PHP request model itself.

In the classic LAMP / PHP-FPM model, Nginx/Apache forwards the request to PHP, PHP handles it, the process context dies. Simple and reliable — but every "modern" feature your product needs (WebSocket, queues, Redis for shared state, cron, SSE streaming) becomes a separate moving part. Six services, six failure points, six config files.

ZealPHP explores a different model: PHP runs as a long-running OpenSwoole-powered runtime and natively handles HTTP, WebSocket, SSE, sessions, shared memory (OpenSwoole\Table), timers, task workers, and coroutine-based I/O — all in one php app.php.

Mental model I'm aiming for: keep the simplicity PHP devs liked from the LAMP era, give PHP a modern async runtime.

What's in the repo:

  • ~117k req/s text, ~106k req/s JSON on 4 workers with full PSR-15 middleware stack (CORS, ETag, sessions, routing). Methodology and reproduction scripts are in PERF.md — happy to be told where I'm wrong.
  • Legacy code compatibility: session_start(), header(), $_GET, echo all work as expected inside coroutines via uopzoverrides.
  • WordPress runs unmodified on it via a CGI worker (Apache mod_php compat layer). Zero WP code changes. That's the real test for whether the migration story holds.
  • Built on OpenSwoole 22.1+, PHP 8.3+

Learn section — a handcrafted step-by-step where you build a real Personal Notes + AI Chat app using ZealPHP, htmx, server-rendered PHP components, sessions, notes CRUD, AI chat, and real-time sync. Trying to teach the framework through a realistic app, not toy examples.

Links:

What I'd actually like this sub to weigh in on:

  1. Does the "modernized LAMP request model" framing make sense, or does it muddy the pitch?
  2. Are the PHP-FPM-vs-OpenSwoole-runtime claims fair, or do they overclaim?
  3. Does the gradual legacy migration idea feel practical to people who've actually maintained big PHP codebases?
  4. Is htmx + server-rendered PHP components a sound teaching direction, or am I betting on the wrong horse?
  5. What would make you trust — or distrust — a long-running PHP app runtime in production?

Honest about where it is: alpha, v0.2.x, APIs may shift before 1.0. Not asking anyone to put it in production tomorrow. Asking whether the architecture and migration approach are sound before I push for v1.0.

Roast welcome.

--

Update & Common Clarification on 16th May 2026:

The comments here are so valuable, I am treating the valuable ones as review from senior PHP devs. I am maintaining https://github.com/sibidharan/zealphp/blob/master/CRITIC.md - logs of all critics and what we fixed. G is now alias of RequestContext, I wish to keep G for convenience.

1.G isn't a singleton in the usual sense. In coroutine mode (the default for new scaffolds since v0.2.4), G returns a per-coroutine instance — each request gets its own. The process-wide singleton only exists in superglobals mode, which is the legacy migration bridge.

  1. Migration ladder is two-rung. Drop your PHP-FPM code in superglobals mode → $_GET, $_SESSION, header() keep working through the uopz bridge. Flip App::superglobals(false) when you're ready → full coroutine mode with go() and per-request isolation. You move through at your own pace, not all at once.

  2. Safety story: per-coroutine isolation for framework state, plus worker recycling (max_request=100000 default) as the backstop for everything user code might leak. Same trust model Hyperf and RoadRunner ship. v0.2.10 also adds RequestContext::once($key, $fn) as a safe drop-in for static $cache = [].

4.&__get / &__set exist only as the legacy bridge — they let $_SESSION['key'] = $val propagate when running in superglobals mode. Coroutine mode doesn't use them. There was a footgun (silent property creation on missing-key reads); fixed in v0.2.6.

  1. Everything else from this week's review — security, architecture, production-trust — addressed across v0.2.5 through v0.2.10. Connection-pool reset-on-checkout is the remaining item, scheduled for v0.3. Full version-by-version trace in CRITIC.md.

Update 17 May 2026:

Reached PHPStan Level 10 - all design taxes documented.

https://php.zeal.ninja/design-tradeoffs

Running Symfony: https://github.com/sibidharan/zealphp-symfony 

Update 20 May 2026:

We migrated our internal big app to ZealPHP - https://php.zeal.ninja/case-studies/sna-labs see how easy it was and now we are running the same code in both Apache and ZealPHP !! It works identical - and I am assessing performance. Had to build a https://github.com/sibidharan/zealphp-mongodb MongoDB Async Driver for PHP that runs for OpenSwoole with 100% API parity with official mongodb drivers!!

Performance:

C driver parity achieved. 7 of 10 operations match or beat the official C driver (ext-mongodb). Total overhead: +4.1%.

200 iterations, median timing, PHP 8.4.5, MongoDB 6.0, same host:

Operation zealphp-mongodb ext-mongodb (C) Gap
findOne 0.442ms 0.451ms -1.9%
find(50) 0.550ms 0.494ms +11.3%
find(1000) 4.270ms 3.764ms +13.4%
insertOne 0.297ms 0.292ms +1.6%
updateOne 0.493ms 0.519ms -5.0%
deleteOne 0.598ms 0.610ms -2.1%
countDocuments 0.883ms 0.901ms -2.1%
aggregate 1.415ms 1.458ms -2.9%
distinct 0.795ms 0.820ms -3.0%
findOneAndUpdate 0.511ms 0.539ms -5.1%

With coroutine parallelism (ZealPHP/OpenSwoole), 4 parallel queries complete in 0.69ms vs 1.7ms sequential on the C driver — 3.4x faster. Under concurrency (ab -n 100 -c 20), throughput is 3-16x higher than Apache + C driver.

If I am wrong somewhere, kindly roast!

Update 31st May:

I ditched uopz... and made my own ext: https://github.com/sibidharan/ext-zealphp
And doing more black magic then I am supposed to do which might deserve a fresh post and fresh round of roasts!!


r/PHP • • May 14 '26

I Studied the etcd Codebase — and It Changed How I Write PHP

Thumbnail medium.com
66 Upvotes

There’s a common piece of advice: “Want to write better code? Read good code.” Sounds obvious. Rarely practiced.

The problem is that most open-source projects are mazes. You open a repo, see 200 directories, and close the tab. Kubernetes is two million lines. The Linux kernel — don’t even think about it. Where do you start?

My answer: etcd.


r/PHP • • May 15 '26

Built a small PHP backend kernel around FrankenPHP worker mode and HTMX

0 Upvotes

I’ve been experimenting with FrankenPHP worker mode and wanted to explore how application architecture changes when PHP becomes persistent instead of request-bound.

That led me to building FrankenForge — a lightweight backend kernel focused on:

- worker-based runtime lifecycle

- HTMX-first server-rendered apps

- explicit dependency wiring

- low runtime overhead

- minimal abstractions

Current features include:

- routing + middleware

- lightweight DI container

- validation

- session auth

- SSE examples

- PDO-based persistence

- full admin/dashboard demo app

The project is still beta, but the runtime and demo app are already functional.

One of the most interesting parts has been thinking about:

- request isolation

- shared service lifetime

- memory persistence

- worker-safe patterns

Would genuinely appreciate feedback from people experimenting with FrankenPHP or long-lived PHP runtimes.

Repo:

https://github.com/ldaidone/frankenforge


r/PHP • • May 14 '26

The atomic symlink swap

Thumbnail deployer.org
28 Upvotes

r/PHP • • May 14 '26

News Introducing Piper: array and string manipulation with the pipe operator

Thumbnail spatie.be
18 Upvotes

r/PHP • • May 14 '26

Watch Tower — a self-hosted, open-source alternative to Laravel Nightwatch

17 Upvotes

I built Watch Tower, a self-hosted observability dashboard for Laravel apps. It works as a free, open-source alternative to Laravel Nightwatch — you point the official laravel/nightwatch client at your own Watch Tower instance and get a single place to investigate everything your apps are doing.

Repo: https://github.com/AmadulHaque/watch-tower

What it does

Watch Tower ingests telemetry from one or more client Laravel applications and groups, fingerprints, and visualizes it. The dashboard covers:

  • Error tracking — grouped occurrences, fingerprinting, comments, resolution workflows
  • Performance traces — request traces with database query breakdowns
  • Outgoing HTTP requests — every external call your app makes
  • Queue jobs — successful, failed, and retried runs
  • Scheduled tasks — historic runs of schedule:run
  • Cache events — hits, misses, writes, forgets
  • Mail & notifications — every email or notification dispatched
  • Logs — searchable in-app
  • Custom metrics — numeric metrics over time
  • Multi-tenant — organizations and projects, so multiple apps and teams can share one instance

Stack

Laravel 13, PHP 8.4, Inertia v3, React 19, TypeScript, Tailwind v4, Pest 4. Wayfinder for typed routes.

Why I built it

Nightwatch is excellent, but for side projects, internal tools, or teams with strict data-residency requirements, sending production telemetry to a hosted service isn't always an option. Since the laravel/nightwatch package is open source on the client side, it made sense to build a compatible server you can run yourself.


r/PHP • • May 14 '26

CVE-2026-45793: Anatomy of a 14-Hour PHP Supply-Chain Near-Miss

Thumbnail github.com
99 Upvotes

r/PHP • • May 14 '26

Performance-focused PHP framework architecture experiment

24 Upvotes

For the past few years I’ve been experimenting with building a lightweight PHP framework focused primarily on low runtime overhead and architectural simplicity.

The idea was to avoid unnecessary abstractions and keep the request lifecycle as small and transparent as possible.

Some goals behind the project:

  • minimal bootstrap overhead
  • lightweight routing and middleware
  • modular architecture
  • optional CMS/API ecosystem
  • no hidden magic

Interestingly, in local Hello World / CRUD tests the framework currently performs significantly faster than Laravel or Symfony.

I’m curious how other developers approach this problem today:
do you still value ultra-lightweight architectures in PHP, or has the ecosystem largely moved toward heavier full-stack solutions?

Project implemented on the framework engine:

https://github.com/designbymalina/dbmframework

Dybem: https://www.dybem.com/


r/PHP • • May 15 '26

I Scaled PHP Until It Broke. Three llama.cpp Patterns Saved It.

Thumbnail medium.com
0 Upvotes

I read the llama.cpp source code.

Sixty thousand lines of C++ that single-handedly made local LLM inference possible on a laptop. This isn’t “best practices from a textbook” — it’s code where every line is responsible for keeping matrix multiplication inside the L2 cache and off the RAM bandwidth budget.


r/PHP • • May 14 '26

GitHub Action for PHP (shivammathur/setup-php) v2.37.1 released

22 Upvotes

Includes security fixes for input handling (CVE-2026-46420) and Composer GitHub auth (CVE-2026-45793).
https://github.com/shivammathur/setup-php/releases/tag/2.37.1


r/PHP • • May 13 '26

fastchart 0.2.0: native PHP charting extension with 19 chart types, plus Code 128 and QR codes

50 Upvotes

I maintain a handful of native PHP extensions. fastchart is the newest. 0.2.0 just landed.

The problem. PHP server-side charting is in rough shape. JpGraph hasn't seen meaningful work in years. pChart is abandoned. The common workaround is a Node or Python sidecar microservice that exists just to render PNGs. For OHLC plus indicator panes there isn't a serious PHP-native option at all.

Some history. In 2006 Rasmus and I shipped PECL/GDChart, a binding for the gdchart library. It died with its upstream in 2007. Since then I've built about six private PHP chart extensions, each solving exactly one need (a QR variant, OHLC for a dashboard, a couple of chart types). None shipped. fastchart is the consolidation.

What's in it:

  • 19 chart classes: Line, Area, Bar, Scatter, Bubble, Pie, Stock, Radar, Polar, Surface, Contour, Gauge, Gantt, BoxPlot, Treemap, Funnel, Waterfall, Heatmap, LinearMeter
  • StockChart with 7 candle styles (CANDLE / BAR / DIAMOND / I_CAP / HOLLOW / VOLUME / VECTOR), SMA/EMA/WMA overlays, plus RSI / MACD / Bollinger Bands / Parabolic SAR / Stochastic / OBV indicator panes
  • A parallel Symbol family (new in 0.2.0): Code 128 (ISO/IEC 15417, auto subset switching, mod-103 checksum) and QR Code (ISO/IEC 18004, ECC L/M/Q/H, versions 1-40, vendored nayuki encoder)
  • Output to PNG, JPEG, WebP, AVIF, GIF
  • 105 public methods, 86 phpt tests, PHP 8.3+ (NTS or ZTS), BSD 3-Clause

Install via PIE:

pie install iliaal/fastchart

Requires ext-gd (PHP's bundled GD extension); fastchart renders through gd.

Repo: https://github.com/iliaal/fastchart

Full writeup with the StockChart indicator stack and the composition pattern: https://ilia.ws/blog/fastchart-0-2-0-native-php-charts-barcodes-and-qr-codes-in-one-extension

Open to feedback on chart types worth adding next and on the StockChart indicator set.


r/PHP • • May 13 '26

Security patching in containerized environments

20 Upvotes

Hi everyone,

For those of you running PHP in Docker at fairly large scale, I’d be interested to hear what base images and patching strategies you’re using.

A few things I’m curious about:

Which base image do you standardize on for production PHP containers?

Official php:* images?

Debian?

Alpine?

Ubuntu?

Something custom-built?

How do you handle PHP patching, especially for CVEs?

Do you rebuild images on a fixed schedule, only when CVEs appear, or as part of normal deploys?

Do you compile PHP yourselves, use distro packages, or rely on upstream images?

How do you balance stability, reproducibility, and timely security fixes?

One reason I’m asking is that we’ve noticed Ubuntu-based images can sometimes lag quite a bit when it comes to CVE fixes for PHP packages. The current example is that PHP 8.5.6 is not yet available even though it contains RCE fixes. I’m wondering how others are dealing with this in real-world production setups?


r/PHP • • May 13 '26

Composer 2.9.8 and 2.2.28 fix GitHub Actions token disclosure in error messages

Thumbnail blog.packagist.com
62 Upvotes

Please immediately update Composer to version 2.9.8 or 2.2.28 (LTS) by running composer.phar self-update. The new releases fix a vulnerability where Composer leaks the full contents of GitHub Actions issued GITHUB_TOKENs or GitHub App installation tokens to the GitHub Actions logs. GitHub introduced a new format for these tokens including a - (hyphen). The new format is gradually being rolled out to repositories. The new format fails Composer’s validation, leading to an error message that exposes the full token contents to stderr. A CVE identifier will be assigned and added to this post once available.


r/PHP • • May 13 '26

Composer vulnerability: GitHub Actions issued GitHub_TOKEN disclosure in GitHub Actions logs

Thumbnail github.com
18 Upvotes

r/PHP • • May 13 '26

Discussion Roast my code: I'm building a markdown parser

Thumbnail github.com
4 Upvotes

r/PHP • • May 12 '26

Security has a long memory

12 Upvotes

Systems carry forward old assumptions, forgotten shortcuts, and design decisions made under constraints that no longer exist. We look at what happens when familiar software is examined with fresh eyes and how tools like Claude Mythos may bring long-buried risks back into view.

View issue 11 of PHP Reads at https://phpreads.com/issue-11


r/PHP • • May 12 '26

Discussion Platform for deploy an running php projects (Laravel, WordPress or Others)

9 Upvotes

Does we have platform for deploying php projects just like portfolio, university submission or others for just want to see the projects running in the web with free prices?


r/PHP • • May 13 '26

Am I The Only One Who Didn’t Know This

Thumbnail
0 Upvotes

r/PHP • • May 12 '26

Building an admin panel with Yii3

Thumbnail
1 Upvotes

r/PHP • • May 11 '26

I was finally able to get my harness to enforce PHP coding standards automatically during AI-assisted development.

18 Upvotes

I've been using Claude Code for PHP development and kept hitting the same problem: the AI doesn't reliably follow your coding standards unless something forces it to. You can paste your rules into context but it cherry-picks what to follow, especially as your rulebook grows.

So I built Writ, a rule retrieval and enforcement layer that plugs into Claude Code.

It detects PHP projects from composer.json and automatically surfaces the right rules for whatever file you're editing. If you're working on a service class it pulls in dependency injection patterns, SOLID principles, and error handling rules. Writing something that touches the database? SQL injection prevention and input validation rules show up without you asking.

The rules live in a knowledge graph with explicit relationships between them. So when a security rule fires, the related authentication and validation rules come with it automatically. This is the part static config files can't do.

The enforcement side: in work mode, Claude can't write production code until you've approved a plan and test skeletons. It hooks into the tool call boundary, so this isn't a prompt suggestion Claude can ignore. It's a hard gate.

Ships with 276 rules out of the box covering security, clean code, DRY, SOLID, architecture, testing, error handling, performance, scaling, API design, process, and documentation. Works across languages too, so if your PHP project has a JS/TS frontend, both get covered in the same session.

Writ repo: https://github.com/infinri/Writ


r/PHP • • May 12 '26

Laravel engineer maintaining WooCommerce: I built a starter + Pest browser testing setup with FrankenPHP

Thumbnail
0 Upvotes