Welcome to /c/PHP!

3 years ago by mbd to c/php

Hey! πŸ‘‹

Whether you're an experienced PHP developer, a beginner just starting your journey, or an enthusiast interested in understanding more about the world of PHP, this is the place for you. We are a community dedicated to sharing knowledge, discussing new trends, and solving problems related to PHP.

As members of this community, we expect everyone to respect each other and foster a positive environment. Please make sure your posts are relevant to PHP, and remember to be kind and considerate in your discussions. Let's learn from each other and help each other grow.

Whether you're here to ask questions or to share your knowledge, we're excited to have you here. Let's make the most of this community together!

Welcome to /c/php! 🐘

dbx12 4 points 3 years ago
path: 0 331384, hotness: undefined, score: 4, children: 4
mbd 1 point 3 years ago

Hey, welcome! Classic haha, I have far too many pet projects as well πŸ˜…

And yeah agreed, it's a bit dizzying to choose a Laravel "path". Would probably be helpful to have a documentation page sort of like the Remix Stacks where they talk a little bit about which "path" to choose depending on app needs.

path: 0 331384 349262, hotness: undefined, score: 1, children: 3
dbx12 1 point 3 years ago
path: 0 331384 349262 359653, hotness: undefined, score: 1, children: 2
Buddhist1961 3 points 3 years ago

This is not a comment trying to convert you to Laravel, but if you or anyone else is interested, an API doc actually exists and is available here.

path: 0 331384 349262 359653 426290, hotness: undefined, score: 3, children: 1
dbx12 1 point 3 years ago
path: 0 331384 349262 359653 426290 433656, hotness: undefined, score: 1, children: 0
cpp_hleucka 2 points 3 years ago

Hey there! I am new here (migrating from Reddit). Full-stack developer (about 7 years). I hope you're all having a great day.

path: 0 388254, hotness: undefined, score: 2, children: 0
garam 1 point 3 years ago

Seems between instance, the old comment isn't synced.. ugh..

path: 0 1120552, hotness: undefined, score: 1, children: 0
Buddhist1961 1 point 3 years ago

Hello, and thanks for creating this community! Sorry if I make grammar mistakes, I'm not a native speaker.

I am a developer who has been working with PHP for a few years now, but I still consider myself a beginner because I'm the sole developer on my company and I have to learn and do all by myself and take all the development decisions. I'm actually relearning PHP and Laravel following more "formal" courses to cover all the bases that I'm surely lacking and then I'm planning to look for a job when I can work as part of a team to learn from other developers.

Speaking about Laravel, I was looking through the fediverse for a Laravel community, as it was a different subreddit from the PHP one on Reddit. But being a small community for now, maybe it's a good idea to keep everything together while the community starts growing? What do you think?

path: 0 195789, hotness: undefined, score: 1, children: 1
mbd 2 points 3 years ago

Solo dev? That's a huge undertaking, especially having to learn by yourself! I think Laravel and Laracasts are excellent starting point to learn "good" PHP and it will definitely open up doors for your next job.

And yes definitely, I think there could be a Laravel specific community!

path: 0 195789 195790, hotness: undefined, score: 2, children: 0
Skyzyx 1 point 3 years ago

My name is Ryan Parman. The most popular (public) projects I've created are SimplePie (RSS), and I brought Tarzan/CloudFusion with me to Amazon to create the AWS SDK for PHP. I care a lot about performance, code quality, and standardization.

These days I don't write much PHP anymore (mostly Golang, Python, Bash, and Terraform now), but I love to stay up-to-date with the community and improvements in the language.

path: 0 385282, hotness: undefined, score: 1, children: 0
msage 1 point 3 years ago

Can anyone here help me understand persistent PDO connections?

So I set up Patroni cluster, everything works as expected. But during the failover/switchover PHP remembers connections to the failed node. And I can't figure out why. Reloading FPM is kind of PitA.

I will use PgBouncer. But I still would like to know how PHP works with the persistent connections.

path: 0 195929, hotness: undefined, score: 1, children: 19
thgs 2 points 3 years ago

I haven't used persistent connections although I have been tempted in the past. I believe, if you haven't used it before, it might come with more trouble than it solves.

As an alternative I could propose using amphp (or maybe react PHP) which will let you handle a pool of connections in a single long running process. But it's a bigger change really, the more I think of it.

path: 0 195929 215237, hotness: undefined, score: 2, children: 16
msage 1 point 3 years ago

Yeah, but any 'single server' PHP defeats the purpose of PHP, so I'm not a huge fan.

I've used them in the past, and they work great, until you have to switchover to another node.

path: 0 195929 215237 216594, hotness: undefined, score: 1, children: 15
thgs 1 point 3 years ago

Fair point.

However why do you need persistent connections ? I am thinking that the growing rate of the connections should be very low as the instances increase, given that the queries are quick.

path: 0 195929 215237 216594 221356, hotness: undefined, score: 1, children: 14
msage 1 point 3 years ago

You lose about 5-6ms just connecting to the database. Keeping them open helps a lot.

My goal is to write as simple code as possible, and everything else is super quick, just the connections aren't handled well in PHP. Which is a shame.

path: 0 195929 215237 216594 221356 228245, hotness: undefined, score: 1, children: 13
mbd 1 point 3 years ago

Honestly I don't know much about this but I think this can occur because PHP (or more specifically, the PDO extension) isn't necessarily aware of the health of the PostgreSQL node it's connected to. From PHP's perspective, it opened a connection, and unless explicitly told otherwise, it will assume the connection remains open. The Patroni switchover/failover is happening independently of PHP. PgBouncer is probably a good solution for this.

path: 0 195929 195930, hotness: undefined, score: 1, children: 1
msage 1 point 3 years ago

If I knew how to invalidate failed connection in the persistent pool, that would be enough.

path: 0 195929 195930 205055, hotness: undefined, score: 1, children: 0
php
php

@programming.dev

login for more options
823
153
10

Welcome to /c/php! This is a community for PHP developers and enthusiasts to share and discuss anything related to PHP. From the latest updates and tutorials, to your burning questions and amazing personal projects, we welcome all contributions.

Let's foster an environment of respect, learning, and mutual growth. Whether you're an experienced PHP developer, a beginner, or just interested in learning more about PHP, we're glad to have you here!

Let's code, learn, and grow together!

go to feed...