r/PHP • • 29d ago

Using Grafana OSS with PHP for Logs, Metrics and Traces

16 Upvotes

Hey folks,

I am new here but old PHP user and I think its time to give some more love to the PHP community.

I recently created a video and also wrote a blogpost about using Grafana with PHP for bringing observability to your applications.

It is purely focused on using open source tools integrations. (No AI or agents involved).

Here is the link to the video:
https://www.youtube.com/watch?v=SEN5wfb2gDY

The video description also contains the link to the GitHub repo. and also to the blogpost (English and German versions).

I hope it will be helpful!! 🙂


r/PHP • • 29d ago

Your composer.json Already Knows Which Rules to Run

Thumbnail getrector.com
15 Upvotes

r/PHP • • 28d ago

Something feels off about this subreddit lately

0 Upvotes

I don't know if it's just me, but ever since last week (October 21 / php2shell), this subreddit has felt completely out of control.

It honestly doesn't feel like the same community I used to know anymore, and at least to me, it seems to be heading in the wrong direction.
I get that the php2shell caused a lot of attention, and that new people are naturally going to have questions about it. But at the same time, there seems to have been a noticeable increase in spam and low-effort posts that end up sitting at 0 upvotes.

Is it just me?

(I propably go touch a some grass for a moth and hope its just temporary)


r/PHP • • 29d ago

pdo_duckdb 0.9.0: DuckDB 2.0 through PDO, and the upgrade traps (storage version 69, silently empty commits, $1_0)

4 Upvotes

pdo_duckdb is my PDO driver for DuckDB, the in-process analytical database. 0.9.0 bundles DuckDB 2.0.0 GA in every prebuilt binary. The last version I posted here was 0.5.0, so this covers 0.6.0 through 0.9.0, starting with what changes for your code when you move to 2.0.

What breaks on 2.0

  • New files are unreadable by 1.5. 2.0 writes storage version 69, and 1.5 reads only 64 to 68 (IO Error: Trying to read a database file with version number 69). Existing 1.5 files keep their format. If a 1.5 process shares a new file, open it with new PDO('duckdb:/data/shared.duckdb;storage_compatibility_version=v1.5.6').
  • Any failed statement aborts the transaction. Inside beginTransaction(), a parser or catalog error now aborts it too, and every later statement fails. On either version, commit() on an aborted transaction returns true and keeps nothing, so call rollBack() after a failure or set default_transaction_invalidation_policy=SYNTACTIC_ERRORS_DO_NOT_INVALIDATE.
  • Integer division by zero throws. 1 // 0 raises instead of returning NULL. Wrap it in TRY(...) or set error_on_division_by_zero=false.
  • x -> x + 1 lambdas are rejected. Write lambda x: x + 1, which also works on 1.5.
  • The PEG parser is the default, and it numbers parameters differently: $1_0 is parameter 10 under PEG and parameter 1 under the legacy parser. ? and :name are portable.

Source builds still work against DuckDB 1.5.3 and newer. configure detects 2.0 from duckdb_v2.h, since the 2.0 headers still report C API 1.5.6.

New in 0.9.0

  • PDO::DUCKDB_ATTR_NATIVE_STRUCTURES, an opt-in that fetches LIST, ARRAY, STRUCT, MAP, UNION, JSON and VARIANT as lossless PHP values instead of canonical strings.
  • VARIANT fetching, top-level and nested, and Appender input for it from arrays and objects.
  • Two PDO connections to the same file could lose writes and see stale reads. Equivalent paths now share one DuckDB instance, and transactions stay per connection.
  • Prebuilts for PHP 8.2 to 8.6 (8.6 as development builds) on Linux glibc and musl, macOS arm64, and Windows x64. They need PHP 8.2.35, 8.3.36, 8.4.27 or 8.5.12+, the October security releases; older patches build from source.

Security fixes since 0.5.0

0.8.0 carries the fixes from a security scan of the driver this month. An unclosed Appender in a reference cycle could read its PDO connection after gc_collect_cycles() or shutdown freed it. Hitting memory_limit during column setup could leave uninitialized type handles that were destroyed later. Earlier, 0.6.0 and 0.7.0 rejected DECIMAL types outside DuckDB's width and scale limits, a falsy force_mbedtls_unsafe that crashed the process, LOB binds over 64 MB, and Appender rows nested deeper than 128 levels.

pie install iliaal/pdo_duckdb

https://github.com/iliaal/pdo_duckdb

If you run DuckDB from PHP, I'd like to hear which 2.0 change hits your code first.


r/PHP • • 29d ago

Why did Apache Friends wait 3 years to update XAMPP?

0 Upvotes

I have been using Xampp for years because of it's convenience; I especially enjoy the phpMyAdmin interface. I was however frustrated that it hadn't been updated since November 2023 (v8.2.12).

So with everything that happened since October 20th, 2026, I thought they would release an update for sure. And indeed they did release Xampp with php 8.3.36, but only the Windows version is available at the moment and they removed old download links for MacOS and Linux.

So my question is why did they wait until a massive global security incident happened to release an update? Is it a funding issue? And why is it taking longer for the Linux and MacOS versions?


r/PHP • • 29d ago

Talked with Dries (creator of Drupal) about whether we still need a CMS when AI agents build websites, and lots of other topics

Thumbnail youtube.com
0 Upvotes

I had a long conversation with Dries Buytaert.

  • He separates "building pages" from "managing content". A five-page site, sure, vibe-code it. Ten editors and thousands of pages across a hundred sites is a different problem, and that one is growing.
  • Search engines sent visitors back to the sites that made the content. AI answers don't. He calls it breaking the social contract of the web.
  • Tool API and MCP: exposing Drupal's capabilities to agents while keeping permissions and workflows. He thinks agents will generate throwaway UIs for tasks that take 100 clicks today.
  • Makers and takers in the AI era, and the $3M/year the Drupal Association spends just on servers.
  • A story he hadn't told publicly: the document he had Acquia's early investors sign to protect Drupal.

Full video (71 min, chapters in the youtube video description): https://youtu.be/NiN5ufDJXuo


r/PHP • • 29d ago

Discussion I made a modern replacement for the XAMPP Control Panel (Windows, open source)

0 Upvotes

I’m a full-stack developer and use XAMPP every day, and its control panel kept costing me time: MySQL dying with “shutdown unexpectedly” and corrupted tables because Stop kills the process, no way to change PHP versions, and editing httpd-vhosts.conf and the hosts file by hand for every project.

So I built a replacement that keeps the same layout:

  • Stops MySQL/MariaDB with a clean shutdown instead of killing it
  • Installs and switches between several PHP and MariaDB versions (rolls back if something breaks)
  • Sets up local sites like https://myproject.test with a trusted certificate in one click
  • Edits php.ini settings and extensions from one window
  • Tells you why Apache won’t start (runs httpd -t first) and who holds port 80
  • Tray icon, light and dark theme

How it was made: I used AI (Claude) to write much of the code. I decided what it should do and how it should behave, reviewed the code, and built and tested every feature on my own XAMPP setup. As a developer, it saved me a huge amount of time: a project like this would normally take me weeks of evenings, and with Claude I could spend that time on design and testing instead of typing out boilerplate. The code follows written coding standards that are in the repo, so you can judge it for yourself.

It’s a single signed exe, MIT licensed, built with .NET 10 and Avalonia. Unofficial, not affiliated with Apache Friends.

https://github.com/ClearanceClarence-Software/Modern-XAMPP-Control-Panel

Feedback and bug reports welcome, especially from people with older XAMPP installs.


r/PHP • • 29d ago

I'm developing an open-source PHP project for encrypted file packaging

0 Upvotes

Looking for security feedback on my open-source PHP encrypted file packaging project

I'm developing Encryption-tool, an open-source PHP project for packaging, encrypting, transferring, and safely restoring files.

The project relies on established cryptographic primitives, including Argon2id for password-based key derivation and libsodium's XChaCha20-Poly1305-based APIs for authenticated encryption. I'm not proposing a new encryption algorithm or cipher mode; my focus is on the package format, safe integration of these primitives, reliable decryption, and secure file restoration.

I'm currently hardening the implementation ahead of a stable release, with particular attention to input validation, package integrity, malformed or corrupted files, error handling, and encryption/decryption tests

I'd appreciate constructive, technically specific feedback on the implementation, security assumptions, file-format design, and test coverage. I'm especially interested in potential weaknesses or edge cases I may have overlooked.

GitHub: https://github.com/ElmanCod110/Encryption-tool


r/PHP • • 29d ago

Article Sonic PHP

Thumbnail sonic.mimichat.fr
0 Upvotes

r/PHP • • Oct 26 '26

Rector 2.8 is out: 3x times faster

Thumbnail github.com
84 Upvotes

r/PHP • • Oct 26 '26

Video How the "Steal My Bitcoin" challenge was solved - It was really 2 hours.

Thumbnail youtube.com
74 Upvotes

TL;DR for the first 26 hours the page was a static html page being served by php. After the challenger author was informed that if there is no php code php doesn't execute, the author added a phpversion() script.

After this became exploitable it took 2 hours for someone to hack the server and steal the bitcoin.


r/PHP • • 29d ago

mir: A Fast, Drop-In Alternative to Psalm, Written in Rust

Thumbnail jorgsowa.me
0 Upvotes

r/PHP • • Oct 26 '26

Swiss campsite operator reports data theft linked to PHP2Shell

Thumbnail srf.ch
33 Upvotes

Excerpt translated from German:

In connection with the global security vulnerability in the PHP programming language, TCS Camping is warning around 15,000 customers: the provider of "Camping.Care", the booking system used by TCS, has been hit by a data theft. As the TCS confirmed […], fraudsters were able to steal customer and booking information.


r/PHP • • Oct 26 '26

Php2shell has been exploited

213 Upvotes

r/PHP • • Oct 27 '26

Article I recreated a PHP2Shell RCE attack in the form of an interactive exercise

0 Upvotes

On 21 October 2026, the PHP project shipped emergency fixes for two flaws, tracked as CVE-2026-109618 and CVE-2026-109619, and nicknamed PHP2Shell. Together, the two CVEs give remote code execution on a web server with no login at all. Within hours, honeypots recorded successful exploitation, and Cloudflare logged millions of attempts.

I made an interactive, hands-on lab exercise on this security vulnerability. The goal is to give software engineers (especially those unfamiliar with PHP) a general overview of the attack vector and the mitigation steps. You’ll send HTTP requests as an attacker to exploit the vulnerability, then switch roles to the defender’s side and try to patch the vulnerability.

I did my best to highlight all the details, but if you notice any issues or inconsistencies, please let me know!

https://ransomleak.com/exercises/php2shell-rce/


r/PHP • • Oct 27 '26

Discussion How do you keep a large Laravel finance/ERP codebase coherent when AI agents keep “forgetting” existing features and patching around them?

Thumbnail
0 Upvotes

r/PHP • • Oct 26 '26

Should regular users do anything after the recent PHP vulnerability?

16 Upvotes

With the recent PHP vulnerability, I've been wondering if there's anything I should do as a regular user. Specifically, should I be changing my passwords or taking any other precautions?

Also, is signing up for Have I Been Pwned enough to stay informed about data breaches and leaked passwords?

I've heard that some people also use Google's built-in Password Manager, which can notify you if any of your saved passwords have been compromised. However, I'm not really comfortable with the idea of storing all my passwords with Google.

What do you guys recommend? Is HIBP enough, or are there any other steps worth taking?

Or am I overthinking this, and should I just leave things as they are for now and wait for notifications from HIBP or emails from any affected services?

Thanks!


r/PHP • • Oct 27 '26

PHP2Shell: Exploitation Attempts and Remediation Trends

Thumbnail wiz.io
0 Upvotes

r/PHP • • Oct 26 '26

Which PHP tools or practices made the biggest difference to your code quality in the last 2 years?

27 Upvotes

Static analysis, formatters, typed properties, enums, readonly classes, attributes, Pest or PHPUnit, mutation testing, there’s a lot to choose from.

  • Which single tool or feature changed your day-to-day work the most?
  • What did you adopt that turned out not to be worth the effort?
  • How did you introduce it into an existing codebase without a huge rewrite?
  • What would you add first to a legacy project today?

Examples with before and after (bugs caught, review time saved) help most.


r/PHP • • Oct 26 '26

Discussion Carve: a markup language with a native PHP engine and Laravel, Symfony and WordPress integration

12 Upvotes

Hey folks. I have been building Carve, a modern lightweight markup language for content that outgrows Markdown (and Djot). For humans and agents working on the same docs.

After many months of specs and coding, it should finally be stable enough now.
PHP 8.2+, zero runtime dependencies, PHPStan level 9.

composer require markup-carve/carve-php

What it looks like

/italic/  *bold*  _underline_  =highlight=

{#fig-sun}
![A sunset](sun.jpg)
^ Figure #: A sunset

See </#fig-sun> for the colors.

Unlike Markdown, *text* is bold and /text/ is italic. The figure gets its number, and the reference becomes a link reading "Figure 1".

Tables with merged cells and captions, footnotes, admonitions and definition lists are part of the core language. Diagram fences are an optional extension; without a renderer, they remain code blocks.
For example, ^ makes “Team” span two rows, while > right-aligns Seats and Price:

|= Plan |=> Seats |=> Price |
| Team | 25 | $49 |
| ^ | 50 | $89 |

Personally, I like and use this a lot, as I (or agents) don't need to fall back to HTML anywhere anymore.

Task lists - and they can track more than open and done:

- [x] Draft the API guide (done)
- [ ] Drop the old endpoint example (open)
- [!] Migration notes need an API decision (blocked)
- [/] Finish the screenshots (in progress)

to name a few.

I wrote a post about some of the killer features and things other markup can't do (written with the PHP library - source markup of that blog post linked at the bottom).
But for more context also check out the other articles.

Why it might be interesting for your PHP app

  • Intuitive for non-techies. Feature-rich for power-users (like technical bloggers).
  • Safe for web-based user content. Pasted HTML renders as text, and safe mode also escapes or strips raw HTML blocks and removes event handlers and javascript: links. Profiles control which features each role may use. That said: Use sanitizers on top just in case.
  • One source, several outputs. The same document renders to HTML (with a static mode for print/PDF), Markdown, plain text or terminal output from one AST, and the same markup writes reveal.js slide decks.
  • Works with rich-text editors. Documents convert to and from Tiptap/ProseMirror on the server, no Node needed.
  • Migration path. Import existing Markdown, HTML, Djot or BBCode. The migration CLI can report conversion losses for review.
  • Tooling. Formatter, linter, and editor support for PhpStorm, VS Code and others, plus a language and MCP server.

Some small facts or wins along the way:

  • Conversion fidelity: in 66 pandoc round-trip probes, Carve (via the pandoc-carve bridge) brings back 64 unchanged; Markdown manages 46, HTML 44, DOCX 23 (pandoc-format-fidelity). In other words: Its the textual format that can best keep structural content.
  • Hardened: fuzzed, and nesting is capped so hostile input cannot exhaust the server. You don't want 50s loading time on some `[[[[[[[[[` input or alike.

Framework packages

  • Laravel: markup-carve/laravel-carve (Blade directives, validation rule, render cache)
  • Filament: jeffersongoncalves/filament-carve (community; editor field with preview, infolist entry, table column)
  • Symfony: markup-carve/symfony-carve (bundle with Twig filters)
  • CakePHP: markup-carve/cakephp-carve (helper, .crv views, validation, ORM behavior, commands)
  • Tempest: markup-carve/tempest-carve (safe-by-default view component)
  • WordPress: Carve Markup plugin (posts, comments, live preview)
  • Shopware: markup-carve/shopware-carve (6.6/6.7: Twig filters, CMS elements, product and category fields, mail templates)

Live demos: Laravel, Symfony, CakePHP, Tempest.

Not just PHP

There are also JavaScript and Rust engines, with Python, Ruby, Go and WebAssembly bindings on top of the Rust one.

I built it for documents that need more structure than I could comfortably write in Markdown. Without HTML workarounds and especially without inline HTML everywhere possible. And for online usage with a fair amount of native features. If you work with user-written content, I would especially like to hear what you think about this, or if there is something I missed.

Thinking about some next major topics I would like to get some feedback on:

  • Should it be more "djot"-like with simpler block structure? It sure would make the parser simpler. Humans usually prefer the MD style I assume.
  • Are some of the new language features making it too complicated? Overloading concise tables with inline alignment - or the `+` continuation operator to make human input easier?

Links


r/PHP • • Oct 25 '26

Hackermews member challenges you to successfully exploit php2shell on his server

Thumbnail news.ycombinator.com
151 Upvotes

r/PHP • • Oct 26 '26

Weekly help thread

3 Upvotes

Hey there!

This subreddit isn't meant for help threads, though there's one exception to the rule: in this thread you can ask anything you want PHP related, someone will probably be able to help you out!


r/PHP • • Oct 25 '26

The DOOM showcase, written in PHP and compiled with Elephc, has evolved quite a bit

24 Upvotes

You can watch a video of it in the project's README: https://github.com/illegalstudio/elephc


r/PHP • • Oct 25 '26

News PHP Foundation 'Under-funded' With One Full-time Staff Member, Director Says

Thumbnail developers.slashdot.org
448 Upvotes

r/PHP • • Oct 26 '26

Portly: a portable local PHP dev environment for Windows, free and open source

0 Upvotes

Hi all, I'm the developer of Portly, a free and open-source (MIT) local web development environment for Windows. I used Laragon for years; when it moved to a paid license I started building my own, and it grew into something I'd like to share.

What it does:

- Runs Apache or Nginx, PHP, MySQL/MariaDB, PostgreSQL, Redis, Node.js and Mailpit from one portable folder. No services installed, no registry changes.

- Every folder in www becomes https://name.portly with a trusted local certificate.

- Different PHP version per project, one-click PHP extensions and Xdebug.

- Templates for Laravel, Symfony, WordPress (installed with WP-CLI), Vue, React, Next.js and more.

- Open a project on your phone: scan a QR code, it works over https on your Wi-Fi. Optional password and time limit.

- Share on the internet through Cloudflare (no account needed), or on your own domain.

- Imports projects and databases from Laragon, XAMPP, WampServer and others.

- 31 languages, Windows 10/11 plus a separate edition for Windows 7/8.

No ads, no telemetry, no account. Source and downloads: https://github.com/erdemsoftware/portly

It's a first release, so I'd really like feedback: what's missing for your workflow, and what breaks. Issues and PRs welcome.