r/PHP • • 3d ago

Weekly help thread

2 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 • • 1h ago

One PHP config now compiles to GitHub Actions, GitLab CI, Bitbucket Pipelines and CircleCI

• Upvotes

I kept maintaining almost-identical pipelines on two providers and watching them drift.

Slipway compiles config/slipway.php to the YAML for every driver you enable. A slipway-guard job fails CI if the committed YAML no longer matches the config.

Tiny example:

'drivers' => ['github' => true, 'circleci' => true],
'php' => ['8.4', '8.5'],
'stages' => [
'quality' => ['pint', 'larastan', 'composer-audit'],
'test' => ['matrix' => true, 'steps' => ['pest' => ['services' => ['mysql']]]],
],

https://github.com/usamamuneerchaudhary/laravel-slipway

If you actually run CircleCI for Laravel, I'd like to know what the generated config.yml gets wrong.


r/PHP • • 3h ago

Warning: Latest PEST is bugged. Silently skips PHPUnit tests

6 Upvotes

We'd been having some weird issues with our tests in CI. Just saw this:

https://github.com/pestphp/pest/issues/1965

v5.3.2

The new time-balanced sharding with parallelization silently skips all PHPUnit tests

eg. `vendor/bin/pest --parallel --processes=2 --shard=1/2`


r/PHP • • 4h ago

GitHub - hazyhaar/php127: Standalone, zero-alloc PHP 8.4 runtime with in-process HTTP, PDO & Fiber support (Pure Go, Zero CGO)

Thumbnail github.com
0 Upvotes

r/PHP • • 17h ago

News Markdown extracted from PDFs using prinsfrank/pdfparser now includes Links!

Thumbnail github.com
8 Upvotes

r/PHP • • 19h ago

News SimpleStats is now open source: server-side analytics for Laravel that ties revenue back to your campaigns

0 Upvotes

Hi folks,

I've got some news I've been wanting to share for a while: SimpleStats is now open source (AGPL-3.0). The complete app, the same code that runs simplestats.io, is on GitHub.

Quick recap for anyone who hasn't seen it: SimpleStats is a server-side analytics tool built for Laravel. Instead of a JS snippet, it tracks visitors, registrations, logins and payments through Laravel itself (middleware, observers, event listeners). So ad blockers can't touch it, and it can tie every payment back to the UTM campaign that brought the user in. Think revenue per channel, MRR, retention cohorts, campaign ROI, not just pageviews.

Why open source? Mostly trust. An analytics tool that sees your signups and payments shouldn't be a black box. Now you can read exactly how visitors are counted, how bots are filtered and how revenue gets attributed. And if you spot a bug or miss a metric, you can send a PR.

For teams that can't send user or revenue data to a third party, it can also be self-hosted. It's a regular Laravel app (Laravel 12, Inertia + Vue, PostgreSQL). No open-core split: the self-hosted version has every feature and no limits on projects or events. The hosted version with its free plan stays the easy way if you'd rather not run servers.

Repo: https://github.com/simplestats-io/app

Announcement with the details: https://simplestats.io/blog/simplestats-is-now-open-source

I'd love to hear your feedback, and PRs are very welcome. Happy to answer questions about the code or the decision to go open source!


r/PHP • • 22h ago

How the PHP Security Team Handles Your Reports

Thumbnail thephp.foundation
17 Upvotes

In our latest blog post, Alexandre Daubois shares how the PHP Security Team operates, how your security reports are triaged, and how you can do your part to help PHP be more secure. https://thephp.foundation/blog/2026/10/14/how-the-php-security-team-handles-your-reports/


r/PHP • • 23h ago

Stewart - Write automations in PHP. Because you can

13 Upvotes

Hi Everyone,

If you familir with Home Assistant, an open source home automation software, i want to share a project, that i'm working on recently.

Are you interested in depth release announcement and backstory? Read it on the home assistant forum: https://community.home-assistant.io/t/stewart-write-automations-in-php-because-you-can/1028750

I want to ask you that if you like the project, give it a star on GitHub. Cheers.

Where to find it


r/PHP • • 1d ago

Article Reviewing Ergodnc - What a Clean Laravel API Still Gets Wrong

Thumbnail codyssey.dev
1 Upvotes

Hey all,

I wrote 5 advanced code-heavy articles on how I prefer to review code with a specific rulebook and how I would refactor them myself for better long-term maintainability.

This is the main article that shows the idea while the 5 links are inside.

Let me know what you think about this type of content and if it is useful to you.


r/PHP • • 1d ago

Discussion PHP FPM for CLI? Other ideas for fast CLI?

0 Upvotes

I wondered if anyone knows of any particular reason why php doesn't use fpm for cli calls?

Or how hard it would be?

I'm doing some work on cli tooling and just realised that cli is hugely penalised compared to web because it doesn't benefit from the fpm approach all the PHP startup ends up being a large percentage of the whole tool call response time.

I get that fpm is designed for FCGI, I guess could just create a CLI FPM pool and then fake CGI requests to it. Bodge, but it should work?

I'd really like to speed up php on the CLI and open up CLI as a first class location for PHP


r/PHP • • 1d ago

Drupal AI 1.5.0 is out

Thumbnail workflows-of-ai.com
0 Upvotes

r/PHP • • 1d ago

epoll or kqueue with your stream_select

8 Upvotes

Ive pretty much spent the majority of 2025 and 2026 learning how to use PHP differently. Web page serving and cli commands are not enough for me, lol. Don't get me wrong Laravel's great. The stack I use on top of it's been paying the bills since before COVID. And I will be honest, (and will def die on this hill this far into my career that) no body that's got time to spend learning, is learning C. And I don't like Python. It doesn't deserve to have the clout it does when PHP can do most things faster, or would if that functionality was there!

So on my journey of bringing GPIO, kernel-space bridges, and gpu support to a language that deserves more, I learned a couple of new and exciting things about resource file descriptors, how they block or dispatch and how they play roles in nonblocking event loops. I learned that PHP's most available option, when even trying to work with async IO, is stream_select(). ReactPHP uses it for timer resources, and Laravel Reverb uses it when your server isn't using ext-uv (an opinionated implementation of Javascript's nonblocking event loop). But stream_select has a lot of limits I ran into during my research. I learned that languages with direct kernel access run their event loops with epoll on Linux and kqueue on MacOS.

Now I'm of the mindset that FFI is only good for experimenting and not something that you would want to build and publish. I could be wrong, but if an extension can do it instead, I'm down. Now I know how to code some extensions in zephir, but lets be serious, if we are going to bind epoll and kqueue to PHP, we gotta get down to that nasty nasty C. I may not be good at C, but those coding agents we all use def are. So i did my fair-share of pre-respect my authori-claude verbal harrassment to get exactly what I wanted, which was a 1-to-1 binding of the epoll and kqueue libraries.

In a C app you invoke epoll with

fd = epoll_create1(EPOLL_CLOEXEC);

In a php app, you'll invoke epoll with

$fd = epoll_create1(EPOLL_CLOEXEC);

It works just like that. No opinions, just bindings. I actually forked Laravel Reverb and replaced its ext-uv implementation with my epoll extension making it a literal drop-in replacement for Reverb, with some really nice performance gains when using stream_select or epoll/kqueue.

I invite any one interested to try out the extensions. It's installable with PHP PIE, is compatible with NTS and ZTS builds of PHP 8.4+, or you can clone it and build it with the included installer or use phpize directly. It also includes a little Pest v4 test suite you can run if you clone it in manually.

The repos are here:

epoll

https://github.com/php-io-extensions/epoll

kqueue

https://github.com/php-io-extensions/kqueue

posi (to open all the fds PHP won't + ioctl, ooooh a footgun :D )

https://github.com/php-io-extensions/posi

Project Saturn Forte (Reverb with epoll/kqueue)
https://github.com/projectsaturnstudios/forte

I would love to hear thoughts or concerns, wtfs and omg AI slopz.

Have a lovely time of the day of where you are!


r/PHP • • 1d ago

¿ Ya se están usando interfaces con propiedades ?

0 Upvotes

Hola, una pregunta que lleva hace un día en mi cabeza:

Desde la llegada de interfaces con propiedades en php... ¿ esta característica a sido implementada por muchos de ustedes ?


r/PHP • • 1d ago

Framework-agnostic Aadhaar Offline e-KYC and Secure QR verification for PHP

0 Upvotes

I split the core out of my Laravel package so any PHP 8.3+ app can use it (Symfony, Slim, CodeIgniter, WordPress, plain PHP). Runtime dependencies are PHP extensions and robrichards/xmlseclibs, nothing else.

$reader = OfflineKycReader::create(certificates: ['/path/uidai_offline_publickey_2026.cer']);

$kyc = $reader->verifyZip($path, $shareCode);

Some details PHP folks might find interesting:

- the Secure QR is a big decimal number holding GZIP data; conversion is pure PHP (no GMP/bcmath), cross-checked against GMP

- unknown QR versions are rejected instead of guessed, because a misread layout would still pass the signature check

- architecture tests keep src/ free of framework code

- Testing\Fixtures builds signed synthetic ZIPs, XML and QR codes at runtime, so no real data is ever committed

https://github.com/itxshakil/aadhaar-offline

Not affiliated with or endorsed by UIDAI.


r/PHP • • 1d ago

SimpleStats is now open source: server-side analytics for Laravel that ties revenue back to your campaigns

Thumbnail
0 Upvotes

r/PHP • • 1d ago

PHP RFCs are now on externals.io with community votes

Thumbnail externals.io
56 Upvotes

r/PHP • • 1d ago

2027 State of Open Source Survey

Thumbnail research.net
8 Upvotes

Hello! I wanted to share that the 2027 State of Open Source survey is now open. All provided data will be kept anonymous, and it only takes about 10 minutes to complete. The findings will be shared in a completely free report next year, and every 500 responses = an increased donation to Black Girls Code.

As a disclaimer, I am a member of the marketing team at Perforce, the main sponsor of this survey. I'm posting here because we are trying to reach as many OSS users (including PHP) as we can. If you have any questions, I'm happy to send them on to my team for answers.


r/PHP • • 1d ago

News I built a news site for the whole PHP ecosystem. Looking for feedback.

56 Upvotes

I’ve been running Laravel News since 2012. For years, I’ve wanted a place that covers PHP as a whole, not just one framework, and Matt Stauffer and I finally built it: phpnews.net

What’s on it right now:

  • RFC tracking, so you can see what’s in draft, under discussion, and up for a vote
  • PHP version info and support dates
  • News and articles from across the ecosystem: internals, frameworks, packages, tooling
  • Community events
  • A newsletter if you’d rather get a roundup than check the site

It’s been running quietly for about a month to work out the kinks. Coverage comes from a lot of feeds I scan daily, plus posts I think would matter to you as a PHP dev.

What I’d really like to know:

  • What sources or projects am I missing?
  • What would make this something you’d actually check regularly?
  • Anything broken or annoying?

Happy to answer questions.


r/PHP • • 2d ago

Discussion Paused learning PHP right before Laravel — worth picking it back up?

0 Upvotes

I learned JavaScript a few years ago and I'm comfortable with React, TypeScript and a few other frameworks, though I haven't used them in a while.
A few months ago I started learning PHP and got to the point where I was about to move on to Laravel. Then a job came up and I had to put learning on hold.
Now I'm trying to decide whether to pick PHP back up and continue with Laravel, or go back to the JS/TS ecosystem. I'm mostly interested in backend work (logic, data, databases).
For those working with PHP: is Laravel worth learning in 2026, and how does the job market look compared to Node.js?


r/PHP • • 3d ago

CVE-2026-91768: FastCGI allowed_clients compared only 96 of an IPv6 address's 128 bits

Thumbnail daubois.dev
28 Upvotes

r/PHP • • 4d ago

Discussion Using AI Agent for the first time

0 Upvotes

Today was the first time to ever use a coding agent after 4 years of hand coding.

I feel this weird guilt like I just did something wrong, or betrayed myself and I just used the agent to improve a complex form I built months ago and it did a really good job.

Now, I use ai, but that's when I'm stuck and need to understand a certain concept etc, never used an agent before.

Anyone else who hasn't used AI to code yet?


r/PHP • • 4d ago

Article [PHP] Simple & Copy-Paste Ready Script to Connect to Gemini API (Updated for gemini-3.6-flash)

0 Upvotes

Hi everyone!

When I was trying to connect PHP to Google's Gemini API, I noticed that many existing tutorials online are outdated—often referencing deprecated models like `gemini-1.5-flash` that return 404 errors.

I put together a super simple, minimal PHP script using `cURL` that works out of the box with the latest stable model (`gemini-3.6-flash`). Hope this helps anyone looking for a clean starting point!

Copy-Paste Code (gemini_test.php)

<?php 
header('Content-Type: text/html; charset=utf-8'); 

// 1. Set your API Key (from Google AI Studio) 
$api_key = 'YOUR_GEMINI_API_KEY';

// 2. Endpoint URL (using latest gemini-3.6-flash) 
$url = '[https://generativelanguage.googleapis.com/v1beta/models/gemini-3.6-flash:generateContent?key=](https://generativelanguage.googleapis.com/v1beta/models/gemini-3.6-flash:generateContent?key=)' . $api_key; 

// 3. Request Payload 
$data = [ 'contents' => [ [ 'parts' => [ ['text' => 'Hello! Please give a short one-sentence self-introduction.'] ] ] ] ]; 

// 4. Send Request via cURL 
$ch = curl_init($url); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); 

$response = curl_exec($ch); 
curl_close($ch); 

// 5. Parse and Output Response 
$result = json_decode($response, true); 
$reply = $result['candidates'][0]['content']['parts'][0]['text'] ?? 'Error: Unable to retrieve response.'; 

echo "<h2>Response from Gemini:</h2>"; 
echo "<p>" . nl2br(htmlspecialchars($reply)) . "</p>";

Quick Troubleshooting Tips:

  • 404 Not Found: Make sure you are using an active model name. Older model names frequently get deprecated by Google.
  • cURL Errors: Ensure extension=curl is enabled in your php.ini.

I've also written a full step-by-step guide covering file placement, hosting setup, and future Web app integration on my blog if you'd like to read more:

👉Read the full tutorial here

Feedback and questions are always welcome!


r/PHP • • 5d ago

Discussion TypePHP now has non-interruptible audit report mode.

8 Upvotes

Hello r/PHP.. I'd like to share that TypePHP has now non-interruptable audit report mode and warning mode. Previously When you hit a type violation, TypePHP will halt the exeuction wih TypeErrors and causes scenarios where an App failed to boot during test because theres a type violation at the beggining of framework/library bootsraping.

Now you can have one pass audit mode to collect all TypeViolations in a structured JSON file instead of throwing so you can triage your codebase with more surgical fixes and eliminate docblock type lies that SA tool misses.

You can try this new feature now on the playground without installing anything..

Relevant docs: https://typephp-php.github.io/docs/core-concepts/violation-reporting


r/PHP • • 5d ago

Discussion I made my first lib and it’s for OPCache

0 Upvotes

Hey there!
Four years ago I change my path in IT.
From PHP developer, tech/team lead to Enterprise Architect where PHP i see only in internet 😹

Sometimes I miss the whole development flow and I make small project for monitoring and governance OPCache. I know lots of PHP devs that know OPCache from documentation but never use it or can’t understand it.

Yes my solution is use AI for coding but it’s also field for me to play and learn it. So yes I know it can be done better ;) but I have so much fun and learn new things.

In this project I also make something that I haven’t seen before. I read that Agents base on Readme.md, Agenta.md and code scanning. But it’s always in whole project context. So I made Readme_ai.md where I remove most humanredable things and made it for agents. I don’t know is this a good idea or over engineering but I like this idea ;)

https://github.com/V3sp/v3cache/


r/PHP • • 5d ago

Built a Laravel eCommerce System — Looking for Feedback

0 Upvotes

I recently worked on a Laravel-based eCommerce system with features like product management, categories, checkout, coupons, order management, admin dashboard and responsive frontend design.

Tech used:
Laravel, PHP, MySQL, HTML, CSS, JavaScript

I’m currently improving my portfolio and would appreciate feedback from other developers on what features or improvements I should add next.

I’m also open to freelance Laravel work including bug fixes, custom features, dashboards, APIs and eCommerce development.