PHP: The latest news in the PHP world

5 readers
1 users here now

Share and discover the latest news about the PHP ecosystem and its community. Please respect r/php's rules.

founded 1 year ago
MODERATORS
26
 
 
The original post: /r/php by /u/brendt_gd on 2024-12-23 07:00:09.

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!

27
 
 
The original post: /r/php by /u/VonFacington on 2024-12-22 17:46:23.

I have an app with Nginx directly serving static content and proxying PHP requests through to FrankenPHP. I recently realized that I was applying encode zstd br gzip at the FrankenPHP (Caddyfile) level and gzip level 6 at the Nginx level. That seemed redundant, so I turned off the encoding at the FrankenPHP level, and that reduced the size of the payload transferred to the browser. Curious as to what kind of configurations those of you with a similar setup have done to optimize how Nginx and FrankenPHP work together?

28
 
 
The original post: /r/php by /u/codemunky on 2024-12-22 17:22:39.

I just happened to have a look at the contents of /var/lib/php/session, and among the thousands of

sess_<32 hexadecimal characters>

files, there's two which are

sess_<32 alpha-numeric characters> (i.e. not just 0-9a-f)

Which seems very strange. Has anyone else ever noticed this or have any explanation for it?

29
 
 
The original post: /r/php by /u/MagePsycho on 2024-12-22 07:54:50.

How many of you have tried Buggregator? 🐛🚀

It's a lightweight, standalone server packed with powerful debugging features for PHP applications.

If you haven't explored it yet, check it out here: https://github.com/buggregator/server.

Would love to hear your thoughts! 💬

30
 
 
The original post: /r/php by /u/marcosiino on 2024-12-21 21:44:34.

Hi, I’ve just published a wordpress plugins called WP-PipeFlow that uses a software I’ve built which allows to make pipelines (workflows) by concatenating stages of any kind, and allows to build custom stages.

I’m writing here because I’m considering extracting the pipeline part from the plugin and making it a standalone php library with its own repository, then distributing it via composer.

Medium article which explains the plugin and some use case:

https://medium.com/@marcosiino/introducing-wp-pipeflow-automate-your-wordpress-workflows-and-look-cool-doing-it-d9775ede36ea

Github repo with the sources, the docs and some other example usecases:

https://github.com/marcosiino/wp-pipeflow

Think of it like a puzzle where you can assemble blocks which perform different works (fetching data from specific rest apis, then passing that data to other data which manipulates them, then fetch other data, or send data to other services, performing operations, passing data to generative AI stages to ask to perform work on it, and so on. Your limit is only your fantasy.

I think it has a great potential as wordpress plugin, but I’m thinking about the value it could have as PHP library and I would like to have suggestions about that.

Do you think it would be useful for a PHP developer and in general for the PHP community?

Thank you!

31
 
 
32
 
 
The original post: /r/php by /u/knightofrohanlol on 2024-12-21 04:13:22.
33
 
 
The original post: /r/php by /u/amfaultd on 2024-12-20 14:21:01.

Cargo for Rust does a lot of stuff to make everyday life easier without needing to branch out to many third party solutions, configure them, somehow make it all work together, etc. Same goes for Deno. You can lint code, format code, run tests, compile to static binaries, check code coverage, and so forth. I'm wondering if there is anything like that for PHP, and if not, would people find something like that useful in the PHP ecosystem?

I find having to set up a Docker with PHPUnit and coverage checking and so forth quite tiresome for each project, and so something convenient like that would be nice to have. Perhaps it could even run with different PHP versions. It could make PHP also a little more accessible for people, or so I think at least. WDYT?

34
 
 
The original post: /r/php by /u/MagePsycho on 2024-12-20 06:35:23.
35
 
 
The original post: /r/php by /u/Wise_Stick9613 on 2024-12-19 22:19:29.
36
 
 
The original post: /r/php by /u/thmsbrss on 2024-12-19 16:58:15.

I'm just updating my LinkedIn profile.

Does "Pragmatic Software Engineer" have a positive or negative meaning for you guys? And why?

37
 
 
The original post: /r/php by /u/samuelgfeller on 2024-12-19 16:20:08.

I'm excited to share this project I've been working on for the past 5 years. I quit my job to focus all my time and energy on learning how to build a lightweight, agile, full-size project.

Code: https://github.com/samuelgfeller/slim-example-project

Documentation: https://samuel-gfeller.ch/docs

I wanted to get my hands dirty in a real project without constraints other than learning as much as I could. So I decided on some basic features that lots of projects typically use such as Validation, Authentication, Authorization, Localization, Users managing resources, Testing, Dark Theme etc.

My goal was to touch as many things as possible and do them cleanly at least once, so that they can serve as templates in my future projects.

So for every little part of this project I did a lot of research, trial and error and carefully chose what worked out the best for me.

The most important priority besides performance was simplicity and intuitive code. In 5 years I still want to understand what I've written (:wink SRP) and hopefully everyone else can also quickly understand my code.

As I progressed I remembered me starting out and being frustrated with tutorials and documentations that either don't really help in a "real-world" context or that require a lot of base knowledge.

I wanted to share everything, so I wrote a documentation with the most simple words that I could find breaking down complex concepts into practical examples without leaving out crucial details that seem obvious to experienced devs but are not for beginners.

Feel free to ask me anything!

38
 
 
The original post: /r/php by /u/brendt_gd on 2024-12-19 09:00:50.

In this monthly thread you can share whatever code or projects you're working on, ask for reviews, get people's input and general thoughts, … anything goes as long as it's PHP related.

Let's make this a place where people are encouraged to share their work, and where we can learn from each other 😁

Link to the previous edition: /u/brendt_gd should provide a link

39
 
 
The original post: /r/php by /u/greg8872 on 2024-12-18 15:05:27.

Just looking for solutions already available for use on a LAMP environment that lets a multiple users store/edit data.

I have done some searching and came up with lots of abstract results on the theory of how to do it, but was wondering if there is a known good package already available ready to go. I have found some solutions, but they are more specific use ones (ie, PassBolt for password sharing), I need to be able to basically have just a open text editor on the page to see/edit whatever the client wants to share with their team.

Thanks.

For reference, I'm used to saving out single user encrypted data, just trying to expand that out to multi users.

40
 
 
The original post: /r/php by /u/hugohamelcom on 2024-12-17 17:50:53.

Been thinking of building a simple analytics using PHP (API endpoint) to interact between the client-side (JavaScript) and the server-side (MySQL).

It's mostly for personal usages on my projects, to have something a bit more adapted for my needs compared to the free options like Google Analytics or Microsoft Clarity.

I know Matomo is built on PHP, but most web analytics are NodeJS based.

How good or bad is the idea to do something like that in PHP?

41
 
 
The original post: /r/php by /u/VaguelyOnline on 2024-12-17 14:47:47.

Laravel Herd UI uses a full CPU core and more when just idling.

Posted on r/laravel but mods removed the post as being a request for help (rule 4). Love herd, but just running it is using ~25% of total system CPU. Not asking for help. Just pointing out that it's currently a dirty dog of a resource hog.

Hard to feel that it's not low-key against r/laravel rules to post something that can be construed as criticism of Laravel.

42
 
 
The original post: /r/php by /u/SabatinoMasala on 2024-12-17 12:13:29.
43
 
 
The original post: /r/php by /u/ReasonableLoss6814 on 2024-12-16 20:47:45.

(as in, no php files needed to run it), would you use it?

This is already possible in some respects by preloading + opcache, but it is currently quite finicky and slightly undocumented; and it requires the PHP files to be present to use. I'm talking about compiling a PHP file into an executable, directly. No php runtime installed or required, no hidden tricks (like extracting the PHP files into a temporary directory), etc.

Edit: this is often called “ahead of time compilation”

44
 
 
The original post: /r/php by /u/fredoche on 2024-12-16 19:02:19.

I tried to demystify DI with hands-on examples. Let me know what you think of my second article:

https://f2r.github.io/en/dependancy-injection

45
 
 
The original post: /r/php by /u/DKnezevic on 2024-12-16 16:41:45.

I was wondering what would be the best way to connect to a remote Oracle db without using oci8. I saw that there is some talk about ADOdb but have no idea if it depends on some other packages or extensions.

What is/would be the best way to go about this based on your experience?

46
 
 
The original post: /r/php by /u/Tomas_Votruba on 2024-12-16 15:19:51.
47
 
 
The original post: /r/php by /u/ask_your_dad on 2024-12-16 13:57:26.

Sorry if this seems too generic, but this is my first major project a new company and I want to make sure I'm doing a good job. I don't have any support really at this place besides myself so I'm a feeling on a island.

I inherited a project that's about 5 years old, php 7.4 and symfony 4.3. I'm tasked to upgrade it.

I wasn't sure the best approach so I've just updated the versions in composer and got it to build. Then I've just been addressing methods that tools/ide complain are deprecated. It's mainly API calls and just db calls so a lot of doctrine updates.

Are there other things I should do or include? The application already has PHPUnit installed, so I was thinking of trying to incorporate those. Some files have a ton of code, lots of sql, was thinking I'd try to decouple some of the sql into their own files or service to help get lines of code lower.

But outside of testing and ensuring a 1 to 1, and just fixing errors as I encounter them, I'm not sure what else I should be doing that a seasoned engineer should be doing.

Thank you.

48
 
 
The original post: /r/php by /u/noweh95 on 2024-12-16 07:58:10.

What mistakes have you made—or avoided—as a Lead Developer?

49
 
 
The original post: /r/php by /u/brendt_gd on 2024-12-16 07:00:09.

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!

50
 
 
The original post: /r/php by /u/D8duh on 2024-12-15 17:37:31.

Hi,

I'm trying to get back into coding PHP but I see that a lot of people recommend Laravel framework. I havent done much coding in about 6+ years besides some css/html. If I wanted to learn Laravel, do I need to relearn PHP first?

Last time I coded in PHP, version 7 had just been released. And back then I just did it for fun so didn't really do anything too advanced.

Thanks in advance for the help. ✌️

view more: ‹ prev next ›