PHP Reddit – Telegram
PHP Reddit
34 subscribers
289 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
Starting a project

I am making software for someone... I am attempting to use Laravel Livewire with Flux pro components and Tailwind css.

I am on windows 11, with nginx (latest), postgres 17, laravel 12, php 8.3 Fast CGI PHP, Flux pro2, using vite for building stuff. I am not using php artisan server I am runnig straight under nginx.

It is turtle slow. takes me about 2.5 seconds to load up a page that is for a logged in user.
Manage User Component page
3 column division

1. has a list of of users right now only 1 user in that list in the main page
2. has 1 livewire component that shows user details and permissions so only hits db for 2 tables.
3. has 1 livewire component with static summaries that have fake output. Meaning no db hits just showing simulated data.

PHP ini I turned off xdebug
PHP ini I turned on Opcache

And I am still getting
12 requests 3.2 MB transferred 4.7 MB resources Finish: 2.41 sDOMContentLoaded: 2.10 sLoad: 2.23 s

Now some of that resources are stuff like last pass that inserts in when serving a page but even turning that off doesn't do anything.

The manage user page which is only 61K takes 1.52 seconds to load. WTF?

I spent 30 years in the microsoft tech stack. I am sick of it was looking for a better experience programming. So I been trying out different tech stacks. I like laravel. I love livewire.

But I really hate the performance I am seeing on something that is a very simple page.

I have no doubt I might be missing something. But I have researched through articles and asked AI and haven't come up with anything that helped except taking away xdebug which took the total serving time from 4.25 seconds to 2.41 seconds that I have now.

Any help would be appreciated. Or is this the performance to expect from livewire or laravel?

Edit: This is just discouraging. I was so happy to see livewire it is similiar to blazor in .net which I liked the concept. I know laracasts runs on laravel and has good performance.

https://redd.it/1m3jzx3
@r_php
Who's hiring/looking

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.

https://redd.it/1m3qqfx
@r_php
Testing Laravel Sanctum SPA auth in Postman (CSRF + session login)

I’ve seen a few tutorials about getting Laravel Sanctum working with Postman (mostly video or blog form), but I figured I’d write a proper GitHub README version — something minimal and straight to the point.

Here’s the repo:
https://github.com/maikeru-desu/postman-laravel-sanctum-auth

It covers:

Setting up your Postman environment
Getting the CSRF cookie
Adding a pre-request noscript that handles `X-XSRF-TOKEN` \+ `Referer`
Making sure protected routes work without hitting auth errors

Main goal was just to make it easier to test Sanctum like a frontend SPA would — without needing to run your React/Vue app.

Hope it helps someone. Feel free to suggest improvements too.

Star it if you find it useful! 👍

https://redd.it/1m40zko
@r_php
Year 0 php dev ,the things one should focus on in their first year to lay a solid groundwork

what should i be learning in my "zero" year??

https://redd.it/1m49j4n
@r_php
CancerStan: My Attempt at autofixing PHPStan errors

I really hate tools that only cry and don't fix "obvious" cases. So i tried to do it myself.
Doesn't cover much cases yet but i've had some fun trying to autodetermine types and building it in general :p
https://github.com/tetreum/cancerstan

https://redd.it/1m4kivu
@r_php
New PDF Parser: maintainable, fast & low-memory; built from scratch

Hi everyone! I've worked at several companies that used some sort of PDF Parsing, and we often ran into memory issues, unsupported features or general bugs. Text/Image extraction from PDFs in PHP has never been easy, until now! I just released v2.2.0 which adds support for rasterized images, which means that text and image extraction are now supporting almost all features!

You can find the package here: https://github.com/PrinsFrank/pdfparser Let me know if you have any feedback!

https://redd.it/1m4r3zt
@r_php
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/1m4u0mz
@r_php
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/1m583od
@r_php
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/1m5b212
@r_php
Why should I use Live Components over a dedicated frontend framework?

I'm working on a project where one of our Symfony Forms is actually a Live Component, and I must say I find it extremely convoluted and harder to grasp than if we had a backend Symfony API with a react/angular frontend.

Maybe it's because it wasn't done properly in the first place, or maybe I am missing something, so I'd like to know other Symfony developer's point of views on the matter.

https://redd.it/1m5crqu
@r_php
How to add URL to errorlog file?

Recently I noticed some errors in my error\
log file, like this one:

>[20-Jul-2025 06:23:41 UTC\] PHP Fatal error: Uncaught OutOfBoundsException: Seek position 10 is out of range in /home/XXXX
Stack trace:
\#0 [internal function\]: ArrayIterator->seek(10)
\#1 /home/XXXXX(147): LimitIterator->rewind()
\#2 {main}
thrown in /home/XXXXXX.php on line 147

So, I know where to look in my code, line 147, but I want to find out which (in my case dynamic) page this triggers. How can I add an URL to this error message?

I can do it for my connections:

if ($mysqli->connecterror) {
$logEntry = date("d/M/Y H:i:s",time()).' '.
$SERVER'HTTP_HOST'.$SERVER['REQUESTURI'].' '.$SERVER['REMOTEADDR'];
errorlog($logEntry);
die("Sorry, connection failed. Please refresh the page (press F5): " . $mysqli->connect
error);
}

But I don't know how to do this with other errors. Thanks for your help.

https://redd.it/1m5cmgp
@r_php
PHP RFC: Deprecate type juggling to and from bool in the function type juggling context
https://wiki.php.net/rfc/deprecate-function-bool-type-juggling

https://redd.it/1m5n2ru
@r_php
Websockets in php

So i have been looking into rachetPHP for websockets and I just cant seem to get it working, as I am able to connect but then messages are not sent to the server as I am not seeing them in the browser nor in the command line from which i have initiated the server. If you have more experience with this please shine some light on me as I am clueless on setting up and managing web sockets in php.

https://redd.it/1m5ov9a
@r_php
Dockerized PHP environments – images for CLI, FPM, and full LEMP/LAMP stacks

Hey folks,

I wanted to share a personal project I’ve been maintaining:
👉 https://github.com/fbraz3/php-system-docs

It’s a collection of Docker images for PHP that I’ve built and refined over time. The goal was to have clean, flexible images for everything from basic CLI tasks to full LEMP/LAMP stacks—ideal for dev environments, CI/CD, or even small-scale production workloads.

Some highlights:

Weekly automated builds
Multi-version support
Lightweight and optimized images
Includes tools like WP-CLI, Composer, Symfony CLI, phpMyAdmin, etc.

Even though I’m not working with PHP on a daily basis anymore, the language played a huge role in my journey as a developer, and I wanted to give something back to the community that helped me grow.

Any feedback or suggestions are welcome—and feel free to open issues, contribute, or just give it a star if you find it useful!

Cheers 🍻

https://redd.it/1m5uih9
@r_php
Tell me about your code quality controls

What have you found to be effective in your ci/cd for code quality?

I want to maximize automated quality enforcement without annoying the Devs. I've already got Pint / phpcsfixer commiting fixes to PRs, via GitHub actions.

My last job was legacy spaghetti hell.

Now I'm tech lead at a scale up with a 1 year old modern code base (TALL11/ php83).
We're taking over as an internal team from an agency.

They've done a good job but the code has been written quite free and breezy, with speed over quality as you'd expect from an MVP product.


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