r/PHP • • 2d ago

Weekly help thread

4 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 • • 13d ago

Who's hiring/looking

19 Upvotes

This is a bi-monthly thread aimed to connect PHP companies and developers who are hiring or looking for a job.

Rules

  • No recruiters
  • Don't share any personal info like email addresses or phone numbers in this thread. Contact each other via DM to get in touch
  • If you're hiring: don't just link to an external website, take the time to describe what you're looking for in the thread.
  • If you're looking: feel free to share your portfolio, GitHub, … as well. Keep into account the personal information rule, so don't just share your CV and be done with it.

r/PHP • • 3h ago

Laravel's move into Rust got me thinking...

41 Upvotes

It reminded me of all the times Taylor and some of his most vocal supporters (especially those who work with him) mocked developers who advocated for stricter code and better coding practices within Laravel. And what do they do now? They embrace one of the strictest programming languages out there. Oh, the irony.

I'm not denying Rust's performance advantages, but I find it hard to believe that performance alone was the driving force behind this decision, especially considering the needs of most web applications.

To me, this looks more like a strategic business pivot aimed at expanding Laravel Cloud's market share and establishing a stronger source of recurring revenue.

After all, deploying a PHP-based Laravel application is incredibly easy these days. You can deploy it on cheap shared hosting, a $5 VPS, a traditional LAMP stack, a Docker container, or virtually any hosting provider that supports PHP. The ecosystem is mature, affordable, widely available, and doesn't tie you to any specific infrastructure provider.

For many small to medium-sized projects, Laravel Cloud offers convenience rather than solving an actual infrastructure problem. With Laravel Rust, however, they have an opportunity to capture a larger share of the hosting market. Many developers coming from PHP who are unfamiliar with deploying Rust applications may naturally gravitate toward Laravel Cloud. From a business perspective, it makes perfect sense.

They've also assured everyone that they won't abandon the PHP version, but I'm highly skeptical of that promise. I wouldn't be surprised if, a few years down the road, the PHP version gradually gets sidelined and eventually abandoned, followed by Taylor's loyal followers gaslighting anyone who reminds them of what was originally promised.

I just hope they don't bring the same culture of framework lock-in to the Rust ecosystem, where otherwise generic libraries gradually become framework-specific packages. (Hey, Spatie, I haven't forgotten what you did with your `data-transfer-object` package.)


r/PHP • • 9h ago

Article Laravel Rust vs PHP: is PHP the bottleneck?

Thumbnail rapira.rs
95 Upvotes

Follow-up to this thread, same setup (1 vCPU per container, Chirper traffic mix). This time the ramp goes up to 5k RPS instead of 2k.

In the original comparison Laravel ran on FrankenPHP and Symfony on Swoole, so the frameworks and the app servers changed at the same time. We added both frameworks on one common base, Rapira. That lets us compare the frameworks on the same app server, and then the same frameworks on different app servers and on Rust.

  • On the same app server, Laravel tops out at about 190 RPS and Symfony at about 2,900 RPS. The bottleneck is the framework and its abstractions, not PHP.
  • Above 2k RPS both Symfony setups beat Laravel Rust: 3,430 (Swoole) and 2,913 (Rapira) RPS vs 2,638.
  • Caddy in front of laravel-rust on 1 vCPU cost 27% of its throughput.

Takeaways

  1. Profile the framework before rewriting in another language. On this API PHP was not the bottleneck. Switching the app server mostly cut memory and errors under load, not RPS.
  2. Fit the data layer to the endpoint: fewer queries and no full model hydration where you don't need it.
  3. Compare runtimes on tail latency, errors under overload and memory, not on a single RPS number.

r/PHP • • 2h ago

The cost of Rust

14 Upvotes

I know Rust pretty well. I did a partial-port, partial-rewrite of a big PHP project into Rust by hand. I've ported two more big systems for Rust using LLMs — one, a toy port of Psalm, and the other a port (playground here) of an 300k-line OCaml typechecker to Rust, which we use in CI at $company.

In all the production uses, the equation was:

benefit = production_savings - development_cost

production_savings = frequency_of_use * cpu_seconds_saved
development_cost = initial_port_cost + frequency_of_updates * seconds_waiting_for_rustc

cpu_seconds_saved: The ported projects were not typical of PHP workloads. They were all massively-CPU-bound, never waiting on a database or memcache, with high frequency use and provably-massive improvements in cpu_seconds_save per execution.

initial_port_cost is undoubtedly cheaper now with LLMs, but not free. Rewriting a large project in Rust by hand used to cost an expensive man-year. Today, porting a 300k-line typechecker cost in the mid-thousands of dollars, token-wise. That port relied on the upstream project's extremely comprehensive acceptance tests.

cpu_seconds_saved is the most important thing to determine before any Rust port. Unless your PHP site is very unusual, it's usually not going to be the biggest deal in the lifetime of any given request.

seconds_waiting_for_rustc we don't run rustc as part of any production deployment for our 15-million-LOC Hack codebase. It makes programs fast, but it is not fast. If your PHP project is > 100KLOC, prepare for a bit of pain.

I think it's really important to remember that your customers do not care about Rust or PHP. They just want to buy some shit on your site, or see what their local team is doing, or whatever. Rust is almost certainly overkill for that, unless you're serving millions of requests a day.


r/PHP • • 3h ago

Update: PHP on a microcontroller grew up and got a composer.json (php-esp32-sdk 2.0)

Thumbnail php-baremetal.com
16 Upvotes

Some of you may have seen php-baremetal before: the project that cross-compiles the actual Zend engine onto ESP32 chips, on a board that costs less than 5$. Not a subset, not a transpiler. Your index.php is the firmware.

Today it hit 2.0,

What changed

  • TOML config become composer.json**.** In 1.x a project was configured with a TOML file. Now it's a normal Composer project. The board, runtime and storage go under extra.baremetal, and config.platform.php is no longer a polite suggestion: it's the PHP version compiled into the chip.
  • "Enable GPIO in the config" become composer require php-baremetal/ext-gpio**.** Every hardware feature is a package now: GPIO, I2C, SPI, Wi-Fi, HTTP/WebSocket, LED strips, displays, touch. PHP's own extensions too (mbstring, pdo_sqlite, opcache…). Don't need Wi-Fi? Then the firmware doesn't compile Wi-Fi.
  • A separate binary become phpbm. The new CLI is written in PHP (of course) and does init, build, flash, sync and monitor. It downloads the SDK as a versioned, sha256-checked archive. composer.lock and phpbm.lock mean "works on my board" now also works on yours.
  • PHP 8.6.0 added, next to 8.3, 8.4 and 8.5. Yes, the microcontroller is on a newer PHP than half the servers out there.
  • And an infinite number of other things .....,I don't want to bore you by listing them all

What didn't change

  • Blink is still your lines of real PHP:
function setup(): void { gpio_mode(2, GPIO_OUTPUT); }
function loop(int $tick): void { gpio_write(2, $tick % 2); delay(500); }

Small things that make me happy

  • Your IDE autocompletes gpio_write(), because every package ships stubs.
  • Boards can name their pins, so Pin::LED_BUILTIN works on the Arduino Nano ESP32 and the Seeed XIAO ESP32-S3.
  • Out-of-memory is now a proper fatal error with file and line, instead of the board quietly rebooting and pretending nothing happened.

No board? The browser simulator (https://sim.php-baremetal.com, built on Velxio) builds your project with phpbm and runs it on an emulated ESP32-S3. Zero soldering.

Custom composer Registry : https://repository.php-baremetal.com/ with all available package

Full write-up, with way too many diagrams: https://www.php-baremetal.com/blog/php-esp32-sdk-2-composer-firmware

MIT licensed. Question for you: does "a hardware feature is a package" feel natural to you, or did we just invent a very small dependency hell?


r/PHP • • 2h ago

Laravel coming to Go

Thumbnail golang.laravel.cloud
6 Upvotes

r/PHP • • 22h ago

Article Laravel Rust is Here

Thumbnail laravel.com
71 Upvotes

r/PHP • • 18h ago

Laravel Rust vs Symfony PHP: results from the same benchmark workload

Thumbnail x.com
35 Upvotes

r/PHP • • 3h ago

Article Two Telegram packages for PHP: a grammY-style bot framework, and a "WhatsApp Web"-style client for your own account

0 Upvotes

Hi r/PHP! I've been building an ecosystem of packages for PAM, a persistent PHP runtime I work on, and just released two for Telegram. Both are Apache-2.0 and on Packagist. I'd love feedback on the API design.

1. `pushinbr/pam-telegram`: a bot framework

It's inspired by grammY and has zero Composer dependencies. It covers commands, filter queries (`message:photo`), middleware, sessions, multi-step scenes, inline keyboards, uploads, long polling and webhooks.

```php

$bot = new Bot(getenv('TELEGRAM_BOT_TOKEN'));

$bot->command('balance', fn (Context $ctx) => $ctx->reply('Your balance: $150.00', [

'reply_markup' => InlineKeyboard::make()->text('Refresh', 'balance:refresh'),

]));

$bot->callbackQuery('balance:refresh', function (Context $ctx): void {

$ctx->answer('Updated');

$ctx->edit('Your balance: $151.00');

});

$bot->run(); // long polling: no public URL, idle bot uses no CPU

```

Scenes handle conversations like "How much? → To whom? → Confirm", with state kept in the session, so they survive restarts.

It runs best on PAM, where the process stays alive and sessions live in memory. It also works on PHP-FPM, Laravel, Symfony or a plain script, with cURL or a stream fallback.

- GitHub: https://github.com/push-in/pam-telegram

2. `pushinbr/pam-telegram-web`: your own account, like a WhatsApp Web client

This one is for when you need to act as yourself, not as a bot. It drives Telegram Web in headless Chrome over the DevTools Protocol. You don't need an `api_id`, Node.js or Puppeteer.

```php

$client = new Client();

$client->onQrCode(fn ($e) => print $e->terminal()); // scan the QR right in your terminal

$client->onPasswordRequired(fn () => $client->submitPassword(readPassword()));

$client->onReady(fn ($e) => print "Connected as {$e->me?->name()}\n");

$client->onMessage(function ($e) {

if ($e->message->text === 'ping') {

$e->message->reply('pong');

}

});

$client->run();

```

You get chats, history, sending, live message events, and `invoke()` for any Telegram API method through the web client's own connection. The session is saved, so you only scan the QR once.

To be upfront: it's unofficial and depends on Telegram Web, so it can break when they change the site. It's meant for automating your own account, not for bulk messaging. Telegram bans spam accounts, and the README says so.

- GitHub: https://github.com/push-in/pam-telegram-web

Which one should I use?

- Building something for other people to talk to: use the bot.

- Automating your own account (reading a channel that has no bot, replying as you): use the web client.

Both READMEs have a 5-minute quick start. Questions, criticism and PRs are welcome, especially on the scene API and the event model. Thanks!


r/PHP • • 1h ago

I rebuilt crawl4ai in PHP: ~20× faster web → Markdown for LLMs, typed extraction, no browser needed

0 Upvotes

Hey r/PHP 👋

I've been using crawl4ai (the popular Python crawler for LLM/RAG pipelines) and wanted the same thing natively in PHP. So I built PAM Crawl: it covers all of crawl4ai's features, with a different engine underneath.

The idea: crawl4ai opens a browser for every page. Most pages don't need one. PAM Crawl speaks HTTP/2 directly (curl_multi), parses with PHP's native HTML5 parser (Dom\HTMLDocument), and only renders JavaScript when a page actually needs it.

📊 Numbers

460 real pages served from a local nginx, each one turned into Markdown + main-content Markdown + links + media:

• pam-crawl, 8 worker processes: 448 pages/s, 418 MB peak RAM

• pam-crawl, 1 process: ~150 pages/s, 94 MB

• crawl4ai, HTTP mode: 7.9 pages/s, 525 MB

• crawl4ai, browser mode (default): 6.3 pages/s, 3.8 GB

The methodology and benchmark scripts are in the repo, so you can reproduce it.

🧑‍💻 What it looks like

// clean Markdown for RAG

$page = Crawl::url('https://www.php.net/manual/en/function.array-map.php')->get();

echo $page->content->raw; // main content only

echo $page->markdown(focus: 'callback'); // BM25: just the relevant sections

// typed extraction straight into your own classes

#[Item('article.product_pod')]

final readonly class Book {

public function __construct(

#[Css('h3 a', attr: 'title')] public string $title,

#[Css('.price_color'), Money] public int $cents,

#[Css('.availability')] public bool $inStock,

) {}

}

$books = Crawl::url('https://books.toscrape.com/')->get()->extractAll(Book::class);

// deep crawl, prioritized, polite

Crawl::site('https://docs.example.com')

->only('/docs/*')->depth(3)->limit(200)

->prioritize(Score::keywords('auth', 'tokens'))

->respectRobots()

->each(fn (Page $p) => $index->add($p->content->raw));

✨ Highlights

• Built for LLMs: clean Markdown, main-content extraction, BM25 focus, citations, chunking.

• Typed extraction with attributes, with fallback chains like #[Css('.price'), JsonLd('offers.price'), Money]. crawl4ai's JSON CSS/XPath schemas also work unchanged.

• LLM features: extraction into DTOs, schema generation, Q&A with citations. Works with OpenAI, Anthropic, Gemini or a local Ollama. "Learn once" mode: the LLM writes the selectors on the first page, and every later page runs without it.

• JavaScript apps without a browser: it reads Next.js/Nuxt/Remix hydration data and finds the JSON APIs behind a page. When you truly need rendering, the optional pam-crawl-browser plugin uses Lightpanda (~42 MB for 8 tabs) or Chrome (screenshots, PDF, logins), only for the pages that need it.

• Crawling: BFS/DFS/best-first, sitemap and Common Crawl seeding, domain mapping, adaptive crawling ("stop when the question is answered"), robots.txt, per-host politeness, HTTP cache with ETag revalidation.

• Interfaces: crawl CLI (crwl-compatible), crawl4ai-compatible HTTP API, MCP server for AI assistants, Docker image.

• Extras crawl4ai doesn't have: change monitoring with diffs, near-duplicate detection, multi-process ->workers(8), PDF parsing in pure PHP.

It runs on plain PHP 8.5 and works best on PAM (https://github.com/push-in/pam), a persistent PHP runtime where connections, caches and extraction plans stay warm between requests. PHPStan level 9, ~370 tests, Apache-2.0. Full credit to crawl4ai for the original design.

🚀 Try it

composer require pushinbr/pam-crawl

• Repo: https://github.com/push-in/pam-crawl

• 28 runnable examples: https://github.com/push-in/pam-crawl/tree/main/examples

• Browser plugin: https://github.com/push-in/pam-crawl-browser

It's a 0.1 release, so I'd love feedback, especially on the API design and on sites where the Markdown or main-content extraction comes out wrong. Happy to answer questions!


r/PHP • • 5h ago

Video Laravel Rust beta: I read the benchmark methodology. The 18x is real, but most of it is just Rust

Thumbnail reddit.com
0 Upvotes

Laravel Rust went into beta on December 1. I went through the announcement, docs and benchmark post, and a few things stood out:

- Laravel Rust did 1,774 req/s vs 97 for Laravel PHP. But Rocket, a plain Rust framework, did 1,623 on the same test.

- The test was a simple read-only app with a 200-row dataset, using each framework's best 10-second window.

- At a steady 50 req/s, latency was close (62 ms vs 78 ms median). The big difference was RAM (16 MB vs 134 MB) and CPU.

- Cold builds on Laravel Cloud: about 3 min vs 27 s.

- What I like most: column types, input authorization and N+1 queries are all checked at compile time.

I made a short 90-second video summarising this (disclosure: it's mine):

Curious what people here think. Would you try it on a real project before 1.0, or wait?

Sources:

https://laravel.com/blog/introducing-laravel-for-rust

https://laravel.com/blog/laravel-rust-benchmark


r/PHP • • 7h ago

Agent Skills in PHP: On-Demand Skills for Neuron AI Agents

0 Upvotes

Alessandro, a friend of Neuron AI gifted the community with this amazing package. After a but of work together I decided to host it under the offical Neuron github organization.

I think it's the better implementation across the agentic frameworks in any stack. It allows you to store skills in different storage layers not only the filesystem, such as a database. You can even implement your custom storage like S3 for example just implementing the package interface.

This is amazing because it fits web application archtiectures where you could need to store skills in the way your application wants to offer this feature to the users or for your own convenience. With this abstraction your agent doesn't care where skills physically are.

This is what PHP needs I think. Thank you Alessandro.

https://www.neuron-ai.dev/blog/agent-skills-in-php-on-demand-skills-for-neuron-ai-agents/


r/PHP • • 1d ago

Migrating from MySQL 8.0 to MariaDB 11.8 LTS: Bagisto's experience, compatibility and benchmarks

Thumbnail reddit.com
0 Upvotes

r/PHP • • 2d ago

I built two open-source tools for working with ESC/POS thermal printers

11 Upvotes

I built two open-source tools for working with ESC/POS thermal printers

If you've ever worked on a POS system, you probably know that getting receipt printers to work reliably can be more annoying than it should be.

A web app needs to communicate with a local printer, different environments use different printer interfaces, and debugging ESC/POS commands without the actual hardware can slow development down.

I built two open-source projects to make that workflow easier.

1. ESC/POS Printer Server (EPS)

EPS is a WebSocket-based printer server for PHP applications. It acts as a bridge between your web/POS app and thermal printers.

Some features:

  • WebSocket communication with payload validation
  • Supports CUPS, Ethernet, Linux USB, SMB, Windows USB, and Windows LPT
  • Web-based GUI for printer management
  • Cash drawer control
  • Optional token authentication
  • Windows and Unix deployment bundles

It's built with PHP 8.3+, Workerman, and ESC/POS-PHP.

GitHub: https://github.com/darkterminal/escpos-printer-server

2. Open POS Printer Emulator (OPPE)

OPPE is a self-hosted web app for testing ESC/POS integrations without needing a physical printer.

It listens for TCP printer connections (port 9100 by default) and renders incoming receipts in the browser.

Some features:

  • Live receipt preview
  • ESC/POS command inspector
  • Hex and Base64 inspection
  • Print job history
  • Configurable TCP listener
  • Fault simulation, including paper out, cover open, cutter error, and offline states

The stack is Laravel 12, React 19, Inertia, TypeScript, and Reverb.

GitHub: https://github.com/darkterminal/open-pos-printer-emulator

How they fit together

The idea is pretty simple:

  • Use OPPE while developing and debugging your ESC/POS integration.
  • Use EPS when your application needs to communicate with real thermal printers.

OPPE helps with testing. EPS handles the production printer connection.

Both projects are open source, and I'd genuinely appreciate feedback from people who have worked with POS systems, thermal printers, or ESC/POS integrations.

I'm especially interested in hearing:

  • How do you currently test receipt printer integrations?
  • Do you use a physical printer for development, or do you have an emulator?
  • What printer models or ESC/POS commands should I consider supporting next?

Happy to hear criticism and suggestions.


r/PHP • • 2d ago

mongo-php-async-driver: an async, drop-in replacement for the MongoDB PHP extension, up to 4x faster

Thumbnail blog.daniil.it
10 Upvotes

r/PHP • • 1d ago

I wrote a PHP extension to turn invoice templates into PDFs without running headless Chrome

0 Upvotes

I needed to generate PDF invoices from WHMCS and WordPress. I wanted to keep writing the templates in HTML and CSS, including the fiddly bits like keeping bank details together when the line items spill onto a second page. I also wanted to do it from PHP without shelling out to a tool or running a Chromium container.

So ended up vibecoding PHP bindings for PlutoBook. Here’s a small invoice in full:

$invoice = new PlutoBook\Document(pageSize: 'A4', margins: '15mm');
$invoice->loadHtml(
    '<h1>Invoice 42</h1><p>Total: 120.00 EUR</p>',
    css: 'h1 { color: #194572 }',
);
$invoice->writeToFile('invoice-42.pdf');

You can install it with pie install oblakhost/ext-plutobook. It’s a native extension, so you need to be able to install extensions on the machine running PHP.

If you’re trying it with an existing template, the first thing I’d check is CSS Grid. My invoice used it for the address columns and payment boxes. Those needed a switch to flexbox. I put the HTML and reference PDFs in the repo so you can judge the result on something more substantial than the snippet above.

https://php.plutobook.dev


r/PHP • • 3d ago

Symfony 8.2.0 released (Official Symfony Blog)

Thumbnail symfony.com
72 Upvotes

r/PHP • • 2d ago

PHP 8.2 to 8.6 on the same machine: JSON encode/decode got 14% slower over four releases, SHA-256 got 5× faster in 8.4, and 8.6.0 alone changed nothing clear

Thumbnail thestacksentinel.com
0 Upvotes

I run a small site that benchmarks releases on my own desktop. This run used one script on every supported PHP line, all in the same run: 8.2.36, 8.3.37, 8.4.28, 8.5.13 and 8.6.0, official php:*-cli images at their built-in defaults. Each number is the median of 11 rounds, and lower is better:

Workload8.2.368.3.378.4.288.5.138.6.0
JSON encode and decode, 20,000 arrays61.4 ms65.8 ms66.6 ms70.3 ms70.3 ms
SHA-256 of 32 MB80.3 ms79.9 ms15.4 ms15.3 ms15.5 ms

The other kernels (regex, sorting, an array with 300,000 keys, string building, a Mandelbrot loop in plain PHP and start-up) showed no clear difference. We call a change only at 10% or more and at least twice the spread, and the same version run twice differed by up to 7%.

A separate run compared 8.5.13 and 8.6.0 directly, plus 8.6.0 with JIT on (opcache.enable_cli=1, opcache.jit=tracing, a 64M buffer):

  • The upgrade alone showed no clear difference on any kernel.
  • JIT on took the Mandelbrot loop from 66.2 to 4.87 ms and string building from 33.6 to 29.8 ms. The array kernel showed no clear difference.

Two things to check before upgrading:

  • 8.6 changes three session defaults, as the ChangeLog says: session.use_strict_mode and session.cookie_httponly are now 1, and session.cookie_samesite is now Lax.
  • The official php:8.6.0-cli image we tested doesn't load mbstring, while the 8.5.13 image did. The ChangeLog documents no removal, so it may come from how the image is built. Does anyone know?

The tracker with every number and the raw JSON: https://thestacksentinel.com/lab/php/ The 8.5 → 8.6 report with JIT: https://thestacksentinel.com/articles/php-8-5-13-8-6-0-jit-makes-mandelbrot-92-6-faster-31bc2ad7/

The JSON slowdown is steady across four releases, so I doubt it's noise. Has anyone seen it in real code?

(Disclosure: it's my site. The numbers come from the linked script and raw JSON; the 8.6 write-up is AI-assisted and I reviewed it.)


r/PHP • • 3d ago

Article The Elephant in the Server Room: Over Half of WordPress Sites Run PHP That's End of Life by January

Thumbnail adamgreenough.net
114 Upvotes

r/PHP • • 4d ago

Article I've been building a PHP CMS and Framework for 3-4 years. Anyone up for trying it?

36 Upvotes

Hey, I’m Stefan. I’m a computer science student, and for the past 3–4 years I’ve been building Advanced Web Tools (AWT) as a side project. It’s a PHP framework with a CMS made entirely of installable packages. Even the "ThemeEngine" is a package.

I’ve spent enough time in it that I know exactly where to click. I’d love to see what happens when someone opens it for the first time.

If you’ve built a WordPress plugin, Laravel package, or Symfony bundle, would you try making something small with AWT? A dashboard widget would do, or you can pick your own idea. I’ll help you get set up. I’m curious what feels easy, where you get stuck, and what you’d miss from your usual tools.

I’m also looking for people to try the CMS demo without a walkthrough. Just open it and see if you can switch themes or make a page in Quill, the visual editor. No coding or design experience needed. If you catch yourself thinking “Where the hell is that button?”, that’s exactly the feedback I’m after.

It’s unpaid, and anything you make is yours. Even five minutes and a note about where you got stuck would help.

If you’re up for either, drop a comment or DM me and I’ll send you the details.

Edit: I dont have demos right now. You can download latest release from GitHub. Extract it then run php -S localhost:3000 path-to-extraction/public/index.php open it in browser and follow the installer. I suggest sqlite databse for start if your php supports it. Or put it in your appache web directory and run it from there. Sorry for the inconveniece.

Edit 2: https://github.com/Advanced-Web-Tools/Advanced-Web-Tools-Framework/wiki/Philosophy

https://github.com/Advanced-Web-Tools/Advanced-Web-Tools-Framework/wiki/Developer-Guide-First-Package

Organization with all my packages:

https://github.com/Advanced-Web-Tools

The framework repo:

https://github.com/Advanced-Web-Tools/Advanced-Web-Tools-Framework

Marketplace/app store for packages:

https://store.advancedwebtools.com

My main site:

https://advancedwebtools.com

All of these were built using my framework and cms system.


r/PHP • • 4d ago

Nitzer - An oldschool TUI toolkit for PHP-CLI

11 Upvotes

For my own needs I've been doing some TUI stuff in a retro BBS/DOS style, and I decided to make a toolkit out of it if anyone else likes this kind of thing. Nitzer lets you do color (ANSI 16 color, 256 or truecolor), ANSI text attributes, cursor movement and manipulation, screen save/restore, input fields (max-length capable, filtermasks, formats, "textarea" style etc, also supports start/end-of line, erase line etc), tables, columns, menu systems/lightbars, navigatable or static tree views, boxes, windows, progress bars, and text effects/animations. Contains a customizeable text file viewer (scrollable) that also natively parses and renders ANSI files (ICE color compatible, SAUCE record supported).

If you wanna spice up your little CLI programs, check it out!

https://packagist.org/packages/nahkampf/nitzer


r/PHP • • 3d ago

Draco Insomnis 0.1.46 — What changed since 0.1.32: file integrity, CVE alerts, namespace isolation, and no more false alarms

Thumbnail github.com
0 Upvotes

Over the last 13 days, I shipped 14 releases for Draco Insomnis (GPL-2.0+), mostly focused on the WordPress integration, though the core architecture applies across the PHP ecosystem.

Quick context: Draco is a self-hosted, open-source security guard that runs entirely on your own server. No external accounts, no cloud telemetry, no captchas, and no subscriptions. Every module ships disabled by default so you only run what you need. Aside from WordPress, it is also distributed for Laravel, Symfony/generic PHP (Server Edition), PrestaShop, Drupal, Joomla, Moodle, and Magento (plus ports in JS, Python, Go, Ruby, .NET, Java/Kotlin, and Rust).

Here is the technical breakdown of what changed between 0.1.32 and 0.1.46:

1. File Integrity Monitoring (Guard) — v0.1.43 & v0.1.45

A new module designed to catch persistence mechanisms after a breach. It verifies core checksums against upstream hashes and watches admin accounts, plugins/drop-ins, config files, unexpected .php files inside upload directories, and cron jobs.

  • Diff-based workflow: You review and approve an initial baseline scan. Subsequent scans run twice a day (taking a few seconds) and only alert on new, modified, or reappearing files (escalating severity if a deleted file returns). It is strictly read-only—it never auto-deletes or mutates files.
  • Eliminating false positives (0.1.45): Tuned the AST/token inspection so empty hosting placeholders, stubbed leftovers, or WAF loaders without executable payloads are downgraded to informational notices instead of firing alert emails. Cron hooks without executable callbacks are also ignored for alerts.

2. Local Known-Vulnerability & CVE Checks — v0.1.44

The integrity engine now runs twice-daily checks against installed packages (including inactive plugins/themes) and core versions, surfacing severity, CVE IDs, patch versions, and closed/abandoned repository status.

  • Zero-leak lookup: Defaults to downloading the full vulnerability feed (via a Wordfence Intelligence mirror) to query locally on the server—no stack fingerprinting or plugin lists are sent outbound. (Optional, off by default).

3. Stricter Edge/Firewall Rules — v0.1.40

Prompted by the recent November Drupal installer exploits (SA-CORE-2026-017 and 019, Fail2Install RCE), the firewall now drops requests (hard 403) to:

  • Core installers (install.php, etc.) on already-provisioned WordPress/Drupal instances (update.php remains untouched).
  • Exposed DB admin tools (phpMyAdmin), raw logs (error_log, debug.log), and backup/editor artifacts (.bak, .old, .orig, .swp).

4. Namespace Isolation in Server Edition — v0.1.46

The standalone PHP Server Edition engines now live under their own dedicated namespace. Previously, running the Server Edition globally alongside a Laravel package or CMS plugin running a different Draco version on the same host could cause class collisions and fatal errors. Also added pre-flight firewall warnings to draco audit (0.1.41).

5. Attack Log Attribution & Phishing Filtering — v0.1.42 & v0.1.43

  • Intent classification: Logged blocks now categorize what the probe was targeting (secrets/config, backups, DB tools, installers, known CVEs like PHPUnit CVE-2017-9841, PHP-CGI, or SPIP) alongside full user-agents and response codes. Admin IPs are flagged and excluded from reports.
  • Local PhishTank checks: Form and comment URLs can be checked against a locally cached PhishTank feed (updated twice daily, commercial-friendly) without leaking user payloads to third-party APIs.

6. Auth, Extensibility, and PHP Lifecycle Warnings — v0.1.33 to v0.1.39

  • Co-signed 2FA: Logins can require approval from a second admin (bound strictly to the session/attempt) or via a single-use approval link sent to secondary recovery emails.
  • Developer hooks: Exposed filter/action hooks so custom or third-party forms can reuse Draco's bot/spam shield.
  • PHP EOL alerts: The dashboard now warns 90 days before your running PHP version hits security EOL. Also fixed an issue where opening SMTP settings overwrote custom ports/encryption presets.

Current Limitations

  • Email-only 2FA: No TOTP, WebAuthn, or passkeys yet.
  • Not an AV/cleaner: Integrity monitors filesystem state changes; it does not scan for malware signatures or clean compromised codebases.

Testing & Source

Release 0.1.46 is tagged with SHA256 checksums, a Sigstore bundle, and an SBOM, tested up through PHP 8.6 and WordPress 7.2. Source and docs are in the repo—if you break something on an unusual server setup or find a bug, please open an issue or report security flaws privately via the repository's Security tab.


r/PHP • • 5d ago

Abandoning DRY on the Hot Path: Significantly Cutting Millions of Function Calls

Thumbnail typephp.dev
46 Upvotes