Optimizing Laravel cold starts on AWS Lambda
https://mnapoli.fr/optimizing-laravel-aws-lambda
https://redd.it/1nfcixx
@r_php
https://mnapoli.fr/optimizing-laravel-aws-lambda
https://redd.it/1nfcixx
@r_php
Hi!
Optimizing Laravel cold starts on AWS Lambda
This article is based on my notes after experimenting with caching as much as possible before deploying a Laravel application to AWS Lambda using Bref. The goal was to optimize AWS Lambda cold starts, without slowing down warm invocations.
Benchmark difference with FrankenPHP vs without FrankenPHP?
I was looking at the TechEmpower Web Benchmark, PHP section: https://www.techempower.com/benchmarks/#section=data-r23&l=zik073-pa7
I would imagine FrankenPHP has better performance because it is written in Go, etc, but I noticed something unexpected from the benchmark.
The best performer is "php-ngx-pgsql" with a score of 785961 but "php-frankenphp" is way down the list with a score of only 129068. FrankenPHP seems to perform even worse than Fiber-based solutions (e.g. Workerman, which has a best record "workerman-pgsql" with score 742577, right after "php-ngx-pgsql").
What might explain this huge benchmark score difference? One guess by me is that the Benchmark did not adjust the FrankenPHP worker count, which greatly limits the performance potential of FrankenPHP. If FrankenPHP is limited by worker count, then naturally it's not gonna perform well.
https://redd.it/1nfohk5
@r_php
I was looking at the TechEmpower Web Benchmark, PHP section: https://www.techempower.com/benchmarks/#section=data-r23&l=zik073-pa7
I would imagine FrankenPHP has better performance because it is written in Go, etc, but I noticed something unexpected from the benchmark.
The best performer is "php-ngx-pgsql" with a score of 785961 but "php-frankenphp" is way down the list with a score of only 129068. FrankenPHP seems to perform even worse than Fiber-based solutions (e.g. Workerman, which has a best record "workerman-pgsql" with score 742577, right after "php-ngx-pgsql").
What might explain this huge benchmark score difference? One guess by me is that the Benchmark did not adjust the FrankenPHP worker count, which greatly limits the performance potential of FrankenPHP. If FrankenPHP is limited by worker count, then naturally it's not gonna perform well.
https://redd.it/1nfohk5
@r_php
www.techempower.com
TechEmpower Framework Benchmarks
Performance comparison of web application frameworks using community-contributed test implementations.
Dealing with Warnings in PHP, the Right Way | nyamsprod
https://nyamsprod.com/blog/dealing-with-warnings-in-php-the-right-way/
https://redd.it/1nfqz2j
@r_php
https://nyamsprod.com/blog/dealing-with-warnings-in-php-the-right-way/
https://redd.it/1nfqz2j
@r_php
nyamsprod | Not a single one of your ancestors died young. They all copulated at least once.
Dealing with Warnings in PHP, the Right Way | nyamsprod
What do you like/dislike about pho
Hello everyone, pretty new coding world, self taught, I’m currently hired on to be a frontend coder, so mostly dealing with Vue, HTML, React, and those type of things. Mainly using VS Code.
But I would like to become more familiar with backend. I already mess with it a bit but not really, I added a missing field that I need for one of my checks.
I know the backend uses Laravel as their framework, php, mongodb and MySQL. And was wondering if anyone could give me some tips or tricks that you wish you knew about working in the backend in general or with php
https://redd.it/1nfuekc
@r_php
Hello everyone, pretty new coding world, self taught, I’m currently hired on to be a frontend coder, so mostly dealing with Vue, HTML, React, and those type of things. Mainly using VS Code.
But I would like to become more familiar with backend. I already mess with it a bit but not really, I added a missing field that I need for one of my checks.
I know the backend uses Laravel as their framework, php, mongodb and MySQL. And was wondering if anyone could give me some tips or tricks that you wish you knew about working in the backend in general or with php
https://redd.it/1nfuekc
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Can someone ELI5 PHP-FPM vs. FrankenPHP?
What are the benefits of each, downsides, support levels, production readiness, etc. I use FPM but have heard that Franken is faster.
https://redd.it/1ng2w8e
@r_php
What are the benefits of each, downsides, support levels, production readiness, etc. I use FPM but have heard that Franken is faster.
https://redd.it/1ng2w8e
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Best way to keep PSR-12 formatting across a whole project?
Finally diving into par formatting, use vscode but would love to have it standardized on the project instead of based on the editor. Any tips/pitfalls?
https://redd.it/1ngbbjo
@r_php
Finally diving into par formatting, use vscode but would love to have it standardized on the project instead of based on the editor. Any tips/pitfalls?
https://redd.it/1ngbbjo
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
SQLite3 class is slower than PDO?
As the noscript says. I noticed the SQLite3 class being consistently slower than using PDO.
In my project i wanted to implement support for multiple database adapters, to take advantage of the extra functionality that the SQLite3 might have to offer. However, after building the abstraction i found SQLite3 to be lagging behind by 2-4ms.
In case you're wondering about the code.
PDOAdapter:
https://github.com/Sentience-Framework/sentience-v3/blob/main/sentience%2FDatabase%2FAdapters%2FPDOAdapter.php
SQLiteAdapter:
https://github.com/Sentience-Framework/sentience-v3/blob/main/sentience%2FDatabase%2FAdapters%2FSQLiteAdapter.php
Any idea what might be causing this?
https://redd.it/1ngchuq
@r_php
As the noscript says. I noticed the SQLite3 class being consistently slower than using PDO.
In my project i wanted to implement support for multiple database adapters, to take advantage of the extra functionality that the SQLite3 might have to offer. However, after building the abstraction i found SQLite3 to be lagging behind by 2-4ms.
In case you're wondering about the code.
PDOAdapter:
https://github.com/Sentience-Framework/sentience-v3/blob/main/sentience%2FDatabase%2FAdapters%2FPDOAdapter.php
SQLiteAdapter:
https://github.com/Sentience-Framework/sentience-v3/blob/main/sentience%2FDatabase%2FAdapters%2FSQLiteAdapter.php
Any idea what might be causing this?
https://redd.it/1ngchuq
@r_php
GitHub
sentience-v3/sentience/Database/Adapters/PDOAdapter.php at main · Sentience-Framework/sentience-v3
Sentience version 3 (2025). Contribute to Sentience-Framework/sentience-v3 development by creating an account on GitHub.
A Week of Symfony #976 (September 8–14, 2025)
https://symfony.com/blog/a-week-of-symfony-976-september-8-14-2025?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1ngm8rz
@r_php
https://symfony.com/blog/a-week-of-symfony-976-september-8-14-2025?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1ngm8rz
@r_php
Symfony
A Week of Symfony #976 (September 8–14, 2025) (Symfony Blog)
This week, Symfony development activity focused on merging pending new features for the upcoming Symfony 7.4 and 8.0 versions. In addition, we announced a new conference: SymfonyDay Montreal on June 4…
Flowforge docs are live! Transform any Laravel model into a beautiful drag-and-drop Kanban board in minutes.
https://relaticle.github.io/flowforge
https://redd.it/1ngpgeu
@r_php
https://relaticle.github.io/flowforge
https://redd.it/1ngpgeu
@r_php
Flowforge
Filament/Livewire Kanban Boards
Transform any Laravel model into production-ready drag-and-drop Kanban boards. Works with Filament admin panels and standalone Livewire applications.
Dilemma: Release my own package or contribute to someone else?
I recently added http logging to my Laravel project, for both incoming and outgoing requests. My reasons were for enhanced security, historical data, and retaining paid API responses such as those from Google APIs. I also made it configurable to include removing sensitive data, ignore certain URLs, pruning, automatic uploads of files, database logging option, etc. I was just about to turn this into a package for release when I found that someone else just recently released a similar package. Their package doesn't do everything mine does, and vice versa, but I don't know if I should release my version or just contribute my ideas to theirs. What is the normal consensus here? I know there are many packages out there that do similar things, but I also don't want to step all over someone else's work.
https://redd.it/1ngprq9
@r_php
I recently added http logging to my Laravel project, for both incoming and outgoing requests. My reasons were for enhanced security, historical data, and retaining paid API responses such as those from Google APIs. I also made it configurable to include removing sensitive data, ignore certain URLs, pruning, automatic uploads of files, database logging option, etc. I was just about to turn this into a package for release when I found that someone else just recently released a similar package. Their package doesn't do everything mine does, and vice versa, but I don't know if I should release my version or just contribute my ideas to theirs. What is the normal consensus here? I know there are many packages out there that do similar things, but I also don't want to step all over someone else's work.
https://redd.it/1ngprq9
@r_php
Reddit
From the laravel community on Reddit
Explore this post and more from the laravel community
Weekly /r/Laravel Help Thread
Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:
What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the r/Laravel community!
https://redd.it/1ngwl0i
@r_php
Ask your Laravel help questions here. To improve your chances of getting an answer from the community, here are some tips:
What steps have you taken so far?
What have you tried from the documentation?
Did you provide any error messages you are getting?
Are you able to provide instructions to replicate the issue?
Did you provide a code example?
Please don't post a screenshot of your code. Use the code block in the Reddit text editor and ensure it's formatted correctly.
For more immediate support, you can ask in the official Laravel Discord.
Thanks and welcome to the r/Laravel community!
https://redd.it/1ngwl0i
@r_php
Laravel
Installation - Laravel 12.x - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
Feedback needed: Stream Pulse Event Streaming & Monitoring Tool (MVP with Redis Streams)
Hey everyone
I’m working on a side project called Stream Pulse a lightweight tool to help developers manage event-driven workflows. The idea is to support multiple backends in the future, but for the MVP (v1) I’m starting with Redis Streams.
What it does so far:
• Uses Redis Streams to handle events.
• UI to monitor streams (consumer lag, event list).
• Configurable retention (how long to keep events).
• DLQ (Dead Letter Queue) for failed events, with retry support.
What I need your help with:
• As Laravel devs, do you find this useful for real projects?
• What features would you want to see in v1 or v2 (e.g. metrics, alerting, integrations)?
• Would you prefer this as a standalone monitoring tool or a package you can drop into Laravel projects?
My goal is to make event handling + monitoring developer-friendly without needing to jump into Kafka/RabbitMQ complexity unless really needed.
Would love to hear your thoughts
https://redd.it/1ngwy63
@r_php
Hey everyone
I’m working on a side project called Stream Pulse a lightweight tool to help developers manage event-driven workflows. The idea is to support multiple backends in the future, but for the MVP (v1) I’m starting with Redis Streams.
What it does so far:
• Uses Redis Streams to handle events.
• UI to monitor streams (consumer lag, event list).
• Configurable retention (how long to keep events).
• DLQ (Dead Letter Queue) for failed events, with retry support.
What I need your help with:
• As Laravel devs, do you find this useful for real projects?
• What features would you want to see in v1 or v2 (e.g. metrics, alerting, integrations)?
• Would you prefer this as a standalone monitoring tool or a package you can drop into Laravel projects?
My goal is to make event handling + monitoring developer-friendly without needing to jump into Kafka/RabbitMQ complexity unless really needed.
Would love to hear your thoughts
https://redd.it/1ngwy63
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Weekly Ask Anything Thread
Feel free to ask any questions you think may not warrant a post. Asking for help here is also fine.
https://redd.it/1nhazyz
@r_php
Feel free to ask any questions you think may not warrant a post. Asking for help here is also fine.
https://redd.it/1nhazyz
@r_php
Reddit
From the symfony community on Reddit
Explore this post and more from the symfony community
Weekly help thread
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!
https://redd.it/1nhdypj
@r_php
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!
https://redd.it/1nhdypj
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
Laravel in 2025: Omarchy, Filament, React, Vue, TypeScript & More
https://youtu.be/pT1ohazYQls?si=D4e6pnBB0YlEf2Fj
https://redd.it/1nhhi6x
@r_php
https://youtu.be/pT1ohazYQls?si=D4e6pnBB0YlEf2Fj
https://redd.it/1nhhi6x
@r_php
YouTube
Laravel in 2025: Omarchy, Filament, React, Vue, TypeScript & More
❤️ sponsor this channel: https://nunomaduro.com/sponsorships 🙌🏻 this video was made possible by:
💎 laracasts / the best way to learn laravel and php: https://laracasts.com/?ref=nunomaduro
🐰 coderabbit / ai code reviews with instant feedback on pull requests:…
💎 laracasts / the best way to learn laravel and php: https://laracasts.com/?ref=nunomaduro
🐰 coderabbit / ai code reviews with instant feedback on pull requests:…
Mysql connection problems, there are too many!
So I am running a site with decent traffic, not sure how many, but maybe 100 - 200 users, possibly up to 1000. I am connecting to a remote mysql database with a limit of 1400 connections.
I configured php-fpm to this:
>pm = dynamic
pm.max_children = 200
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_spare_servers = 190
pm.max_spawn_rate = 32
When running ps -ef | grep php-fpm I got 31 processes. Somehow through, they generate more than 1400 mysql connections! I set PDO::ATTR_PERSISTENT => true to the PDO instance:
$db = new PDO('mysql:host=' . DBHOST .
';dbname=' . DBNAME . ';charset=UTF8', DBUSER, DBPASS,
PDO::ATTR_PERSISTENT => true
);
$db->setAttribute(PDO::ATTRERRMODE, PDO::ERRMODEEXCEPTION);
$db = new PDO('mysql:host=' . DBHOST .
';dbname=' . DBNAME . ';charset=UTF8', DBUSER, DBPASS,
PDO::ATTR_PERSISTENT => true
);
$db->setAttribute(PDO::ATTRERRMODE, PDO::ERRMODEEXCEPTION);
I also have an Illuminate capsule instance called by this noscript:
// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
$capsule->bootEloquent();
<?php
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
requireonce 'vendor/autoload.php';
$capsule = new Capsule;
$capsule->addConnection([
'driver' => 'mysql',
'host' => DBHOST,
'database' => DBNAME,
'username' => DBUSER,
'password' => DBPASS,
'charset' => 'utf8mb4',
'collation' => 'utf8mb4unicodeci',
'prefix' => '',
'options' => [
PDO::ATTRPERSISTENT => true // Enable persistent connections
]
]);
// Set the event dispatcher used by Eloquent models... (optional)
$capsule->setEventDispatcher(new Dispatcher(new Container));
// Make this Capsule instance available globally via static methods... (optional)
$capsule->setAsGlobal();
// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
$capsule->bootEloquent();
<?php
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
requireonce 'vendor/autoload.php';
$capsule = new Capsule;
$capsule->addConnection([
'driver' => 'mysql',
'host' => DBHOST,
'database' => DBNAME,
'username' => DBUSER,
'password' => DBPASS,
'charset' => 'utf8mb4',
'collation' => 'utf8mb4unicodeci',
'prefix' => '',
'options' => [
PDO::ATTRPERSISTENT => true // Enable persistent connections
]
]);
// Set the event dispatcher used by Eloquent models... (optional)
$capsule->setEventDispatcher(new Dispatcher(new Container));
// Make this Capsule instance available globally via static methods... (optional)
$capsule->setAsGlobal();
Essentially, I run this noscript every time I access a PHP noscript. So I have two connections, one "raw" PDO and one Illuminate Capsule. What might be the problem?
I am trying to think of how to solve this, I need to throttle the connections. Implement a pool or something. I am quite limited on options since my server only have 2GB ram.
https://redd.it/1nhh9cg
@r_php
So I am running a site with decent traffic, not sure how many, but maybe 100 - 200 users, possibly up to 1000. I am connecting to a remote mysql database with a limit of 1400 connections.
I configured php-fpm to this:
>pm = dynamic
pm.max_children = 200
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_spare_servers = 190
pm.max_spawn_rate = 32
When running ps -ef | grep php-fpm I got 31 processes. Somehow through, they generate more than 1400 mysql connections! I set PDO::ATTR_PERSISTENT => true to the PDO instance:
$db = new PDO('mysql:host=' . DBHOST .
';dbname=' . DBNAME . ';charset=UTF8', DBUSER, DBPASS,
PDO::ATTR_PERSISTENT => true
);
$db->setAttribute(PDO::ATTRERRMODE, PDO::ERRMODEEXCEPTION);
$db = new PDO('mysql:host=' . DBHOST .
';dbname=' . DBNAME . ';charset=UTF8', DBUSER, DBPASS,
PDO::ATTR_PERSISTENT => true
);
$db->setAttribute(PDO::ATTRERRMODE, PDO::ERRMODEEXCEPTION);
I also have an Illuminate capsule instance called by this noscript:
// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
$capsule->bootEloquent();
<?php
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
requireonce 'vendor/autoload.php';
$capsule = new Capsule;
$capsule->addConnection([
'driver' => 'mysql',
'host' => DBHOST,
'database' => DBNAME,
'username' => DBUSER,
'password' => DBPASS,
'charset' => 'utf8mb4',
'collation' => 'utf8mb4unicodeci',
'prefix' => '',
'options' => [
PDO::ATTRPERSISTENT => true // Enable persistent connections
]
]);
// Set the event dispatcher used by Eloquent models... (optional)
$capsule->setEventDispatcher(new Dispatcher(new Container));
// Make this Capsule instance available globally via static methods... (optional)
$capsule->setAsGlobal();
// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
$capsule->bootEloquent();
<?php
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
requireonce 'vendor/autoload.php';
$capsule = new Capsule;
$capsule->addConnection([
'driver' => 'mysql',
'host' => DBHOST,
'database' => DBNAME,
'username' => DBUSER,
'password' => DBPASS,
'charset' => 'utf8mb4',
'collation' => 'utf8mb4unicodeci',
'prefix' => '',
'options' => [
PDO::ATTRPERSISTENT => true // Enable persistent connections
]
]);
// Set the event dispatcher used by Eloquent models... (optional)
$capsule->setEventDispatcher(new Dispatcher(new Container));
// Make this Capsule instance available globally via static methods... (optional)
$capsule->setAsGlobal();
Essentially, I run this noscript every time I access a PHP noscript. So I have two connections, one "raw" PDO and one Illuminate Capsule. What might be the problem?
I am trying to think of how to solve this, I need to throttle the connections. Implement a pool or something. I am quite limited on options since my server only have 2GB ram.
https://redd.it/1nhh9cg
@r_php
Reddit
From the PHP community on Reddit
Explore this post and more from the PHP community
SymfonyCon Amsterdam 2025: Coping With a Bad Sequel: SELECT * FROM Regret
https://symfony.com/blog/symfonycon-amsterdam-2025-coping-with-a-bad-sequel-select-from-regret?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1nho0bj
@r_php
https://symfony.com/blog/symfonycon-amsterdam-2025-coping-with-a-bad-sequel-select-from-regret?utm_medium=feed&utm_source=Symfony%20Blog%20Feed
https://redd.it/1nho0bj
@r_php
Symfony
SymfonyCon Amsterdam 2025: Coping With a Bad Sequel: SELECT * FROM Regret (Symfony Blog)
🌀 SQL is bending under the weight of modern data. Join Andreas for a whirlwind tour from its tidy-table origins to today’s tangled mix of JSON, documents, and hybrid query languages—and see whe…
I turned FilamentPHP into a no-code app, sort of
Hi,
I want to start by saying that I enjoy using FilamentPHP, have been working with it since v2, on various projects, and now it is my go-to tool when creating anything admin panel-related.
With that being said, you still have to code stuff, so I thought, what if I could make FilamentPHP work as a no-code tool?
So I did that, sort of. Well, I did mostly a demo, you can basically create TextInput, Selects, and define one-to-one and one-to-many relationships.
Now to share some technical details. The whole project runs on SQLite (I was inspired by PocketBase and the idea of having a lightweight, standalone, independent tool that doesn't need any other resources running to use it other than the web server itself). In order to make this thing work alongside Laravel and FilamentPHP I created a GenericModel class to talk with the database, custom migrations for database relationships as well as a somewhat easy-to-extend builder for forms and tables.
The project is of course very early, there is stuff that works on the surface, but if you look behind the scenes is not good code, there is no docs, no way to extend anything other than modifying the core.
Long story short, if you are curious, want to share any feedback, or anything really here is a link to the repo https://github.com/morfibase/morfibase
https://redd.it/1nhq1ap
@r_php
Hi,
I want to start by saying that I enjoy using FilamentPHP, have been working with it since v2, on various projects, and now it is my go-to tool when creating anything admin panel-related.
With that being said, you still have to code stuff, so I thought, what if I could make FilamentPHP work as a no-code tool?
So I did that, sort of. Well, I did mostly a demo, you can basically create TextInput, Selects, and define one-to-one and one-to-many relationships.
Now to share some technical details. The whole project runs on SQLite (I was inspired by PocketBase and the idea of having a lightweight, standalone, independent tool that doesn't need any other resources running to use it other than the web server itself). In order to make this thing work alongside Laravel and FilamentPHP I created a GenericModel class to talk with the database, custom migrations for database relationships as well as a somewhat easy-to-extend builder for forms and tables.
The project is of course very early, there is stuff that works on the surface, but if you look behind the scenes is not good code, there is no docs, no way to extend anything other than modifying the core.
Long story short, if you are curious, want to share any feedback, or anything really here is a link to the repo https://github.com/morfibase/morfibase
https://redd.it/1nhq1ap
@r_php
GitHub
GitHub - morfibase/morfibase
Contribute to morfibase/morfibase development by creating an account on GitHub.
Free Udemy Course: PHP REST API Cybersecurity (Deal Ends Soon)
https://cybersecurityclub.substack.com/p/free-udemy-course-php-rest-api-cybersecurity
https://redd.it/1nhumea
@r_php
https://cybersecurityclub.substack.com/p/free-udemy-course-php-rest-api-cybersecurity
https://redd.it/1nhumea
@r_php
Substack
Free Udemy Course: PHP REST API Cybersecurity (Deal Ends Soon)
If you want to strengthen your skills in securing PHP REST APIs, you can now enroll in this Udemy course at no cost with a limited-time coupon.