33
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Atto Version 2: single file, no dependency, Pure PHP Server implementations for HTTP/2, IMAP+SMTP, TURN, and more
https://github.com/cpollett/atto
https://redd.it/1t5rh5h
@r_php
Symfony 8.1.0-BETA1 released
https://symfony.com/blog/symfony-8-1-0-beta1-released?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1t5in08
@r_php
Symfony 6.4.38 released
https://symfony.com/blog/symfony-6-4-38-released?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1t5f8rk
@r_php
Symfony 7.4.10 released
https://symfony.com/blog/symfony-7-4-10-released?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1t5c0nc
@r_php
Problems with outdated api documentation
Hi, I usually work as an app developer, so please bear with me.
I have experienced this issue multiple times, when implementing a new feature that requires an endpoint, the documentation is either incomplete or outdated.
This could be a missing error response or wrong data types in the response.
So I thought of making a tool to help prevent this, but it turns out to be quite difficult.
So I got curious, is this simply a skill issue/laziness in my company or do others face this too?
If you're already solving this issue, what do you do?
Note: the developers in my company are not bad, from my perspective. But mistakes do happen from time to time.
I'm just looking for a way to prevent it.
https://redd.it/1t58oak
@r_php
CI/CD pipelines for PHP - what's the cheapest check you've added that saved you the most pain?
What's the cheapest CI check you've ever added that caught the most bugs?
The question came up while writing my latest newsletter edition. Two things triggered it: a payment provider shipping a literal syntax error to production (a php -l run would have caught it in 200ms), and CVE-2026-40176/CVE-2026-40261 dropping - a CVSS 8.8 command injection in Composer's Perforce driver that composer audit wouldn't even catch, because the attack vector was the package manager itself.
It got me thinking about how much low-hanging fruit most closed-source PHP pipelines leave on the table, compared to the well-maintained open source ones.
First couple things that come to mind: php -l across your whole src/ in parallel, composer audit on every PR, and if you're on a legacy codebase - PHPStan with a baseline so you're only failing on new errors, not drowning in thousands of old ones from day one.
I wrote a bit more on it here: https://phpatscale.substack.com/p/php-at-scale-20 \- but I'm more interested in hearing what's actually working for people here. I know the most I've learned on CI/CD stuff was when I usually joined a new project, that had a different approach.
https://redd.it/1t56jhs
@r_php
How long do your Feature tests take to run in your CI?
https://redd.it/1t4n9ap
@r_php
What is the oldest PHP version you still use?
However small the project, professional or not. What’s blocking the upgrade?
View Poll
https://redd.it/1t4icwk
@r_php
get random `SQLITE_CORRUPT` errors hours later with no obvious trigger.
There's also a hosted dashboard you can find on the github repo that connects to your Postgres with credentials you control if you don't want to build a UI yourself. The agent is fully usable without it and stays MIT either way.
Repo: [https://github.com/lemed99/nightowl-agent](https://github.com/lemed99/nightowl-agent)
Packagist: `composer require nightowl/agent`
Happy to answer questions on the architecture, the COPY drain, the fork-safety stuff, the parallel-with-Nightwatch mode, or anything else. Feedback very welcome.
Thank you.
https://redd.it/1t4f8cd
@r_php
Parallel Branches in Neuron AI Workflow
https://inspector.dev/parallel-branches-in-neuron-ai-workflow/
https://redd.it/1t4b9n9
@r_php
Reviewing my AI-built Laravel + Inertia/React frontend: locally great, globally drifting
https://spatie.be/blog/locally-great-globally-drifting
https://redd.it/1t48sm0
@r_php
Bootstrapping a Frameworkless PHP Application
https://maximegosselin.com/posts/bootstrapping-a-frameworkless-php-application/
https://redd.it/1t42pdg
@r_php
I built an open-source ReactPHP-based telemetry agent for Laravel. It drives data from Nightwatch package into your own Postgres database via the COPY protocol
Hey folks. I've been working on this for a while and finally pushed the project out.
Quick context on why it exists. Laravel shipped `laravel/nightwatch` as the official observability SDK and the instrumentation is genuinely good. The catch is that the data goes to Laravel Cloud and you pay per event. If you grow, you must call your bank. If you wanted to keep that telemetry on your own infra, you were out of luck and if you wanted to keep it for a while, you must call your bank again.
So I wrote an agent that slots in front of Nightwatch and redirects its ingest to a local TCP socket. From there:
1. Payloads hit a ReactPHP non-blocking listener (about 13,400 payloads/s on a single instance in my benchmarks)
2. They get buffered in a local SQLite WAL (zero re-encode, raw wire JSON straight in)
3. `pcntl_fork`'d drain workers ship them to your Postgres via the COPY protocol with `synchronous_commit=off`
That's it. Telemetry never leaves your network. You install the package, point it at a Postgres database you provision, run `nightowl:install` then `nightowl:agent`, and the tables fill up. All 12 Nightwatch record types: requests, queries, jobs, exceptions, commands, cache, mail, notifications, outgoing HTTP, scheduled tasks, logs, users.
It also runs in parallel with Nightwatch hosted if you want to trial it without ripping anything out. Set `NIGHTOWL_PARALLEL_WITH_NIGHTWATCH=true` and a `MultiIngest` adapter wraps Nightwatch's `Core::ingest` binding and fans out to both backends. Every payload goes to Laravel Cloud and to your Postgres. You can compare them side by side and decide.
What you actually get:
* Exception fingerprinting (repeats roll up into one issue keyed on `group_hash + type + environment`)
* New-issue alerts via Email (BYO SMTP), Webhook (HMAC-signed), Slack, or Discord
* Threshold-based performance issues (slow request, slow query, slow job, etc.)
* Agent and host self-diagnosis (ring buffers, EWMA, 19 rules covering drain lag, buffer depth, CPU, memory)
* Raw rows you can query with `psql`, point Metabase at, or build your own UI on
P95s, N+1 detection, slow-query rankings... those are queries you write. The schema is documented and stable.
Stack details for the curious:
* PHP 8.2+, Laravel 11 or 12
* ReactPHP for the event loop and TCP/UDP sockets
* SQLite WAL as the buffer (NORMAL sync, 64MB cache, mmap)
* Postgres COPY for 10 high-volume tables, INSERT only for the 2 upsert tables (exceptions and users)
* 5,000 rows per COPY batch, configurable
* `NIGHTOWL_DRAIN_WORKERS=N` for parallel drain, `SO_REUSEPORT` for multi-instance on Linux
Repo: [https://github.com/lemed99/nightowl-agent](https://github.com/lemed99/nightowl-agent)
Packagist: `composer require nightowl/agent`
Happy to get your feedbacks on this and to answer questions about the architecture, the COPY drain, the fork-safety stuff (closing the SQLite PDO before fork was a fun bug), or anything else.
Thank you.
https://redd.it/1t3lq3h
@r_php
Flare ❤️ Livewire
https://flareapp.io/blog/flare-livewire
https://redd.it/1t3fozi
@r_php
Lunar vs Shopper - best Laravel + Filament e-commerce solution?
I currently use WooCommerce for my clients' e-commerce projects, but I want to move away from WordPress entirely. I'm already using Filament for CMS features on simpler websites, and it works great, so now I want to start building webshops with it too. Building a full e-commerce solution from scratch is more work than I can take on right now, so I'm looking at existing solutions that use Filament for the admin panel and that I can extend myself.
My shortlist comes down to Lunar and Shopper. Lunar seems more mature, with more features and a larger community. Shopper's development principles appeal to me more though, and align better with how I build my regular Laravel projects (event-driven, with the ability to override specific components or features). Shopper's admin also feels a bit more user-friendly than Lunar's, but I haven't used either in depth yet, so that's just a first impression based off their websites & docs.
The first webshop will be a simple store with regular products and some variants. Other stores I've built with WooCommerce were more complex, with product bundles, custom shipping logic, EU OSS tax calculations, PDF invoice generation, third-party accounting integrations, and so on. I want to make sure whatever I pick can grow into that kind of complexity later on.
Looking for recommendations and experiences from anyone who has used either one, or both. Thanks!
https://redd.it/1t3d66z
@r_php
I retested the two main Laravel module packages under load, one of them collapses at 32 workers
https://redd.it/1t5n5gm
@r_php
Symfony 8.0.10 released
https://symfony.com/blog/symfony-8-0-10-released?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1t5f8rf
@r_php
Lerd v1.19, follow-up to the launch post here, big update on the local PHP dev env
http://github.com/geodro/lerd
https://redd.it/1t56amt
@r_php
Lerd v1.19, follow-up post, FrankenPHP and a few Symfony-relevant updates
https://github.com/geodro/lerd
https://redd.it/1t5725h
@r_php
New in Symfony 8.1: Method-Based Commands
https://symfony.com/blog/new-in-symfony-8-1-method-based-commands?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1t587vn
@r_php
Lerd v1.19, follow-up to the post from a while back, lots of new Laravel-side stuff
http://github.com/geodro/lerd
https://redd.it/1t56e07
@r_php
I built a PHP framework with its own file-based database, query language, auth system and remote server module — looking for feedback
https://github.com/Troyer05/SecondServerModul
https://redd.it/1t4f9g8
@r_php
New in Symfony 8.1: HTTP-Less Symfony Applications
https://symfony.com/blog/new-in-symfony-8-1-http-less-symfony-applications?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1t4g4m6
@r_php
I built a self-hosted alternative for `laravel/nightwatch` and it's open source
Posted a version of this yesterday on r/PHP and it seems some people liked it, so I'm very excited to bring it here as well. Hope you'll find it helpful.
Quick context on why this exists. Nightwatch is great. Honestly, the moment Laravel announced it I was sold. The instrumentation covers everything I could need: requests, queries, jobs, exceptions, and many more. Twelve record types, all available on the SDK side.
What kept bugging me was the hosted side. You pay per event, you start sampling once you grow, and your telemetry lives on Laravel Cloud. For a lot of apps that's totally fine. But I kept thinking about the cases where it isn't: high-traffic apps that don't want to sample anything, regulated stacks where stack traces can't leave the perimeter, smaller teams whose Postgres already has the headroom to absorb the writes. They want the same SDK pointed somewhere else.
So I wrote an agent that slots in front of Nightwatch's ingest binding and redirects payloads to a local TCP socket. From there:
1. A ReactPHP non-blocking listener accepts them on `127.0.0.1:2407` (around 13,400 payloads/s on a single instance in my benchmarks. That's enough headroom for an app doing 2,000-5,000 req/s without sampling)
2. They land in a local SQLite WAL buffer with zero re-encoding (raw wire JSON goes straight in)
3. `pcntl_fork`'d drain workers ship them to your Postgres via the COPY protocol with `synchronous_commit=off`
You install the package, point it at a Postgres database you provision, and the tables fill up.
composer require nightowl/agent
php artisan nightowl:install # publishes config + runs migrations against your PG
php artisan nightowl:agent # starts the daemon (TCP 2407, UDP 2408, health 2409)
The service provider auto-redirects Nightwatch's ingest to the local socket. You don't need to wire anything else up. Telemetry never leaves your network.
It also runs in parallel with Nightwatch hosted, which is the part I'd flag if you're curious but not ready to commit to anything. Set `NIGHTOWL_PARALLEL_WITH_NIGHTWATCH=true` and a `MultiIngest` adapter wraps `Core::ingest` and fans every payload out to both Laravel Cloud and your Postgres. The fan-out runs after Nightwatch has accepted the payload, so it can't break the path you're already paying for. You run them side by side, see what your data actually looks like in your own DB, and decide from there.
What you actually get out of the box:
* Exception fingerprinting (repeats roll up into one issue keyed on `group_hash + type + environment`)
* New-issue alerts via Email (BYO SMTP), Webhook (HMAC-signed), Slack, or Discord
* Threshold-based performance issues (slow request, slow query, slow job, etc.)
* Agent and host self-diagnosis (ring buffers, EWMA, 19 rules covering drain lag, buffer depth, CPU, memory)
* Raw rows for every record type you can query with `psql`, point Metabase at, or build your own UI on
P95s, N+1 detection, slow-query rankings... those are queries you write against your own tables. The schema is documented and stable.
Stack details for the curious:
* PHP 8.2+, Laravel 11 or 12
* ReactPHP for the event loop and TCP/UDP sockets
* SQLite WAL as the buffer (NORMAL sync, 64MB cache, 256MB mmap)
* Postgres COPY for 10 high-volume tables, INSERT only for the 2 upsert tables (exceptions and users)
* 5,000 rows per COPY batch, configurable
* `NIGHTOWL_DRAIN_WORKERS=N` for parallel drain, `SO_REUSEPORT` for multi-instance on Linux
A couple of things I learned the hard way that might save someone else the weekend:
* `PRAGMA busy_timeout` has to be set **before** `PRAGMA journal_mode = WAL`. Do it the other way and the first concurrent write under load races and one of the writers gets `SQLITE_BUSY` immediately instead of waiting.
* When you `pcntl_fork`, close the parent's SQLite PDO **before** the fork and recreate it in both parent and children after. Otherwise the child's destructor tears down file locks the parent still thinks it owns and you
Malicious Intercom PHP Package Follows NPM Compromise
https://socket.dev/blog/mini-shai-hulud-packagist-malicious-intercom-php-package-compromise
https://redd.it/1t4b227
@r_php
LuandaPHP 2.0 release announcement
Wrote a little library for whoever cares, primarily myself, so I don't need to write HTML anymore. Contrary to other HTML builders this is fully OOP with good intellisense support, loads of helpers so go try it. Available on Packagist and GIT.
Going to expand with my own minimalist tools in the future releasing additional branches.
https://packagist.org/packages/tamasvarga/luandaphp
https://github.com/vargatam77/LuandaPHP/tree/2.0
In large works with frameworks too, but it wasn't meant to. Pure PHP8.2
https://redd.it/1t43yr2
@r_php
Telepage v1.1.0 — self-hosted PHP app that turns any Telegram channel into a searchable website (major security + tooling update)
**Telepage v1.1.0 — vanilla PHP 8.1 + SQLite, turns a Telegram channel into a searchable website**
Posted an earlier version here a while back and got roasted — deservedly. The feedback was useful and I spent some time fixing the things that were called out.
GitHub: https://github.com/scibilo/telepage
What the app does: webhook + History Scanner to pull a Telegram channel into a self-hosted searchable website. No MySQL, no Node, no framework. Targets shared hosting.
**The technical changes:**
Composer autoload is in — single `require vendor/autoload.php` across all entry-points, vendor/ pre-built in the release zip. PHPUnit test suite (37 tests). GitHub Actions CI on PHP 8.1/8.2/8.3. PHPStan level 5, zero errors.
First PHPStan run found 5 real bugs. The most interesting: a `return false` in a method typed `?int`, which the caller was silently casting to 0 — channel mismatch was being swallowed entirely. Static analysis is worth it even on small projects.
Security audit: CSP, HSTS, session cookie flags (Secure/HttpOnly/SameSite=Lax consistently), input validation on the public API, webhook body cap, OOM-safe JSON import, FTS5 replacing `LIKE '%q%'`.
Admin API was 1172 lines. It's now a dispatcher + 4 modules.
Happy to take questions or more criticism.
https://redd.it/1t3ptqi
@r_php
[FREEMIUM] WebSocket/SSE relay for WordPress, with RTC provider support.
/r/WordpressPlugins/comments/1t3k85r/freemium_websocketsse_relay_for_wordpress_with/
https://redd.it/1t3k9ln
@r_php
phpexcel 2.0: ground-up rewrite of the C extension, 9-10× faster than PhpSpreadsheet
I've maintained phpexcel since 2008. 2.0 shipped in April as the first ground-up rewrite, and 2.0.1 just landed on May 3.
The problem it solves: PhpSpreadsheet builds the whole DOM in PHP memory. On a 50K-row spreadsheet you're looking at ~790 MB resident before you've called save(). In a 128 MB FPM pool that means OOM on anything past trivial. OpenSpout streams, but it can't write conditional formatting, formulas, rich text, or .xls.
phpexcel wraps LibXL through a native C extension. LibXL (libxl.com) is a commercial C++ library by Andrew Karasyov, not mine; you acquire it separately. phpexcel is the PHP binding.
Quick comparison. PhpSpreadsheet is the most feature-complete pure-PHP option. OpenSpout fills a streaming niche. phpexcel is the C-extension answer for when you need both speed and full Excel features.
What 2.0 changed:
- PHP 8.3 / 8.4 / 8.5 / master, dropped older versions
- LibXL 4.6.0+, newer features gated at compile time
- 12 classes (6 new: ExcelRichString, ExcelFormControl, ExcelConditionalFormat, ExcelConditionalFormatting, ExcelCoreProperties, ExcelTable)
- 399 typed parameters, 277 typed return values, full arginfo coverage from a stub-driven build
- Installable via PIE
Benchmarks against PhpSpreadsheet 5.5.0, PHP 8.4.19 NTS:
| Rows | Cells | phpexcel | PhpSpreadsheet | Speed |
|------|-------|-----------|----------------|-------|
| 1,000 | 20K | 0.05s / 85 MB | 0.45s / 162 MB | 10× |
| 10,000 | 200K | 0.55s / 153 MB | 4.59s / 282 MB | 9× |
| 50,000 | 1M | 2.72s / 508 MB | 24.7s / 790 MB | 9× |
| 100,000 | 2M | 5.37s / 908 MB | 51.1s / 1,415 MB | 10× |
Read perf is similar: 8-9× faster than PhpSpreadsheet, 3× faster than OpenSpout (with proportional memory trade-off vs OpenSpout's flat 130 MB).
2.0.1 is a hardening pass: extensive error checking and input validation across the C/PHP boundary.
Install:
pie install iliaal/php-excel --with-libxl-incdir=/path/to/libxl/includec --with-libxl-libdir=/path/to/libxl/lib
Full writeup with methodology: https://ilia.ws/blog/php-excel-2-0-the-c-extension-for-excel-that-php-should-have-had-all-along
Repo: https://github.com/iliaal/phpexcel
https://redd.it/1t3fkv8
@r_php
Concurrent programming in PHP without async frameworks (no ReactPHP, no Amp, no Swoole)
https://deployer.org/blog/master-server
https://redd.it/1t3deip
@r_php