PHP Reddit – Telegram
PHP Reddit
34 subscribers
291 photos
37 videos
24.9K links
Channel to sync with /r/PHP /r/Laravel /r/Symfony. Powered by awesome @r_channels and @reddit2telegram
Download Telegram
Memory usage issue (leaks) after upgrading Symfony 6.4 to 7.3

Hey! Has anyone experienced memory leak issues in recent Symfony versions? Upon upgrading directly from 6.4 to 7.3 I started noticing that the PHP-FPM pod/container grows memory usage indefinitely:

Growth rate: about 15\~20 MB/hour. Doesn't seem affected by usage: about the same rate at peak or idle hours.
Growth is approximately steady, no frequent "bumps"
Kubernetes, GKE
The metric I'm using is "container memory used" (container_memory_used_bytes)
PHP 8.3, official Docker images, Debian Bookworm
The most relevant extension that I thought could interfere was ddtrace (DataDog Tracer), but disabling it (by removing extension=ddtrace.so) caused no impact.
OPcache is enabled; checking its own metrics, memory usage is stable and doesn't grow indefinitely
Restarting PHP-FPM workers doesn't seem to recover enough memory; currently working with pm.max_requests = 200. Also tried manual restarts with kill -USR2 <master_pid>.
Seems like a problem with FPM only or with the HTTP part of Symfony only - no memory issues for my queue consumers (custom implementation, not using Symfony Messenger)
I'm going to try downgrading to Symfony 7.2, 7.1, 7.0 and see if the issue persists

I also tried digging for other solutions with ChatGPT, which pointed me to possible lower-level issues, extensions leaking shared memory, but was hoping to find other people with the same issue,

https://redd.it/1lq8ixr
@r_php
PHP Hate, but what about Java?

I'm a PHP'er since 20 years with some side steps to Node. Actually I started in 1998 when classis ASP and VB where still popular.

For fun I was reading into Spring/JAVA:
https://spring.io/guides/gs/accessing-data-mysql

I find the code it produces really, really ugly and unreadable. I see so much PHP hate, here on Reddit and from professional programmers (A lot do Java). But what is the core of that?

https://redd.it/1lqila8
@r_php
FrankenPHP - any reason why not?

I've been watching the PHPVerse 2025 FrankenPHP creator talk about all the great features (https://www.youtube.com/watch?v=k-UwH91XnAo). Looks great - much improved performance over native php-fpm, and lots of good stuff because it's built on top of Caddy. I'm just wondering if there are any reasons why not to use it in production?

Is it considered stable? Any issues to watch out for? I like the idea of running it in Docker, or creating a single binary - will the web server still support lots of concurrency with thread pools and the like or does all the processing still go through the same process bottleneck? I especially like the Octane (app boots once) support - sounds super tasty. Anyone have personal experience they can share?

https://redd.it/1lqpkfq
@r_php
Self hosting Docker PHP setup for Laravel help

Been learning Laravel on and off for the past year. I haven’t built a production app yet, but I’ve been really interested in setting up a docker Compose setup to run Laravel on a VPS. I know there are hold are alternatives like Laravel Forge, Envy, Cloud, or Ploy.io or Server Avatar or Coolify or Vito Deploy, but I want to learn the hard way first.

Laravel is a breath of fresh air with its batteries-included approach, but I’ll be honest, it’s definitely not as straightforward to get running compared to what I’m used to with node and svelteKit. With those, I just build the app using a node docker image, copy it into the container, throw in a Caddy container, and it's good to go.

PHP, on the other hand, comes with a bunch of Linux dependencies and PHP-extensions etc etc, and it’s not always obvious which ones are needed.

To help myself learn, I created a small example repo with a dummy Laravel app and Docker setup. It runs the whole stack entirely in Docker, using separate containers for:

\- Postgres
\- Caddy
\- Horizon
\- Redis
\- (mailpit and adminer just for testing)

Anyone with experience, got advice?

Here is a link to the public repo I made to figure it out and learn alone the way:

Maxiviper117/example-laravel12-docker

welcome to post issues on it.

https://redd.it/1lqqe6b
@r_php
FrankenPHP on Laradock - Sharing Production Configuration

Doing a quick project, so need to know if we you have any recommendations on what I can improve to configure FrankenPHP to work with Laradock.
I created a derived project from Laradock.
I cannot create the Caddyfile that works with all static content and LetsEncrypt Certificate. Any help will be appreciated. Here is the project repo: Project Repo - Laradock + FrankenPHP + Caddy

https://redd.it/1ls4jci
@r_php
Ai Bundle

A while ago I started creating a Bundle helping me to integrate LLMs into my Symfony applications. Its supports calling the most popular providers like OpenAi, Anthropic, Google, Mistral, DeepSeek, Ollama with a unified interface. It also supports with building prompts, tool calling, returning structured data from the LLM and a basic chat persistence.
Lately I also added tool calling via MCP (stdio and HTTP) and providing MCP tools (via. HTTP).

I know, I’m not the only one with this kinds of bundle, but maybe someone finds it useful:
https://github.com/johannes85/AiBundle

https://redd.it/1ls7qn7
@r_php
Function for my php chat that seems impossible to find

Guys good evening! I'm having a problem finding a function that helps me save a series of images in an ever-changing folder on my computer created through variables. It seems impossible in Chrome now due to harmful privacy policies. I also tried creating extensions but I just can't. It seems like all my attempts are met with the impossibility of achieving it. Obviously when the site is in localhost I can perfectly transfer the photos wherever I want.. help... thank you very much!!!!

https://redd.it/1lsgt5l
@r_php