/r/PHP

Photograph via snooOG

Share and discover the latest news about the PHP ecosystem and its community.

Please respect r/php's rules.

Please follow the rules

Releases: Current Releases, Windows Releases, Old Releases

Contribute to the PHP Documentation

Related subreddits: CSS, JavaScript, Web Design, Wordpress, WebDev


/r/PHP is not a support subreddit. Please visit /r/phphelp for help, or visit StackOverflow.

/r/PHP

176,203 Subscribers

12

Is this a good way to learn

So iv started to learn php, and I’m curious has anyone learnt by looking at a project that’s in another language eg JavaScript and then recreating that same project in php?

Edit: thank you for all the replies, so I’m assuming to have a little bit of knowledge about php first is best, and then try recreating something

What about following a step by step guide, not a video but like a guide that shows you what to code and you follow along to get an understanding of how and where is this also good ?

13 Comments
2024/11/02
21:15 UTC

0

PHP Sample : Zero-Downtime Blue-Green Deployment with a Simple 'Git pull & bash run.sh' Command

3 Comments
2024/11/02
14:31 UTC

1

Exploring New Opportunities: Seeking Advice on Tech-Friendly Destinations for Engineers

Hey team!

I’m a PHP developer fluent in Arabic, French, and some English, and I’ve been working in France for a while now. Lately, though, I’ve been feeling that the job market here isn’t very rewarding, especially with salaries. I’m certified in Symfony and try to stay active by contributing to open-source projects here and there. But with the economic situation in France right now, it feels like engineers aren’t really valued as much as they could be.

I’m considering a move to a place that genuinely appreciates tech professionals—where you feel that your skills are an asset, and where there’s good career growth and stability. Do you have any advice on countries or regions that are currently strong in tech, offer competitive pay, and provide a good work-life balance?

1 Comment
2024/11/02
11:12 UTC

18

Share your stories of scandal

When talking to a friend recently, they told me surprising story. They had uncovered a major security vulnerability within the codebase of company they were working for.

They informed the relevant people in charge and even offered to fix the problem. The company refused and then a couple weeks later they lost their job.

I’m curious, how many of you have stories like this? Stories of technical, ethical, and procedural failures that were ignored or covered up.

*If your story is confidential, please reach out to me via pm.

24 Comments
2024/11/02
08:32 UTC

14

Site made in laravel and livewire , gets getting high traffic and takes a lot to load, siteground hosting.

Hi guys , i made a website that you only have to insert codes that you can get from a bottle cap , you can insert till 12 codes in the same page , the website is simple , a typical form , and made with livewire for submission.

I validate the codes thought a secondary database made in sqlite in wal mode because Aaron Francis said that was faster , this database has 30+ million codes in it , and all the form data is inserted on a mysql database, i only use this database has a code validation.

people can register every time they want and can have a duplicated email ( the client said this , i dont have nothing to do about it ) , also the client did not include a captcha.

The website is hosted in Siteground and for some reason this hosting is getting too much traffic and collapsed, we had to upgrade about two time with cpu and memory.

i put sessions over memcache.

Does anyone can help me if there is another approach to this?

By the way , the client exceeds original numbers that they told us about how much people will reach this promotion or they lie and they wanted a cheap service.

56 Comments
2024/11/01
12:36 UTC

0

We need a different documentation for Procedural PHP

It’s sad to see the language leaning more towards OOP. Where in the past we could choose either a procedural or OOP implementation of some stuff…I see now from the get go almost everything is OOP. Makes me super sad.

18 Comments
2024/11/01
00:20 UTC

55

Any fullstack devs who has built fast using PHP ? If so what's your stack ?

I was going through videos of a youtuber/solpreneur. He sells a nextjs based boilerplate to make and ship apps fast. He actually released a bunch of apps. I am leaving out the name so this post doesn't look like a promotion.

Am sure people are doing this in PHP world as well. Curious what framework/stack PHP people are using for building rapid

His stack: Next.js , mongodb (supabase) , mailgun, some next.js based authentication and of course tailwind

Edit: Follow up to laravel: any streamers/youtubers who cover rapid building with laravel ?

192 Comments
2024/10/31
18:45 UTC

9

NativePHP Child Processes - Real-time Messaging and Persistent Processes

1 Comment
2024/10/31
13:18 UTC

32

Tempest alpha 3 releases with installer support, deferred tasks, class generators, and more

Hi reddit

You might have seen previous posts, and already know that myself and a handful of developers are working together on a new PHP framework called Tempest. Today we released the third alpha version. This one includes support for package and component installers — so that you can run eg. ./tempest install auth, and all auth related files will be published in your project. We also added a defer() helper, inspired by Laravel, which can run tasks in the background after a response has been sent to the client. We added class generators and working on support for make: commands, and quite a lot more.

During the past month, we merged more than 60 PRs, and had 13 people contribute to Tempest, which is far exceeding my expectations. It's great seeing so many people come together and work on so many different things; and I'm really excited to see Tempest evolve in the coming months!

If you're interested, you can read all about this new alpha release over here: https://tempestphp.com/blog/alpha-3/

10 Comments
2024/10/31
07:55 UTC

0

(blogpost) The Irony of Static Typing in Dynamic Languages

Do you also think PHP and Python are becoming closely similar to C++ after the recent updates of adding static typing features?
I explain my point of view about these recent changes in this blogpost. A bit sarcastic, but I provide examples how and when to use static typing in PHP and Python.

27 Comments
2024/10/29
14:09 UTC

35

Is Symfony really a minimalist framework?

I'm planning on building a small website project for myself, and decided to try basing it on Symfony. Mostly I wanted to avoid Laravel because the company I used to work for uses Laravel, and I wanted to try something different. What I want to build is small enough that I could probably do it from scratch, but this seemed like a good opportunity to learn something new I could use in the future.

I followed the guide to install and set up the Symfony framework. I ended up with 9681 files! 8526 of these are .php files. What definition of "minimalist" are we using here?

68 Comments
2024/10/29
18:13 UTC

1

Logging under Azure App Service?

The application insights PHP repository was archived back in 2022.

https://github.com/microsoft/ApplicationInsights-PHP

Those of you running a PHP app on Azure app service, are you using application insights with the old library, app insights via some other method, or are you using a non-Azure logging solution like Monolog?

And if you're using Monolog/etc are you logging into files, DB, or a service like loggly?

0 Comments
2024/10/29
15:14 UTC

0

Magento to Microservices

I have 4 websites that runs on Magento 2 framework with 90% same business use case and project definition. They all work the same way where user creates order from platform and pushed to Magento DB and later to an ERP. All the 4 sites are hosted on different servers with different databases. We create new site by replicating the older one and replacing with different logo and name for different companies and host it on independent server. Since this is redundant in terms of code and buying new server plan, could you suggest an approach that will help me with below

  1. Rewrite the Magento codebase and convert into Microservices based REST API. The Microservices will cater current and future sites but should also be scalable for new users and suggest best Microservices framework that works well with ReactJS from frontend perspective.
  2. Having the Microservices on cloud like AWS and built frontend in ReactJS kind of framework so one frontend and API architecture will serve all sites 4.

I am confused between REST API vs Microservices usage on this approach and if someone could guide would be helpful.

Thanks

26 Comments
2024/10/29
13:45 UTC

33

Was elastic/elasticsearch-php removed from GitHub?

https://packagist.org/packages/elasticsearch/elasticsearch

This package's canonical repository appears to be gone and the package has been frozen as a result.

Does anyone have some insights on what's going on?

https://github.com/elastic/elasticsearch-php returns a 404

22 Comments
2024/10/29
12:26 UTC

10

Do you know a better (still cheap) VPS for PHP that has a good CPU power?

Please, check the link below. Thank you so much for your recommendations.

https://www.reddit.com/r/VPS/s/lUU8BSNhCV

60 Comments
2024/10/29
08:14 UTC

3

New Devdojo Wave V3 SaaS Starter Kit release is very cool

I am in no way affiliated with Devdojo but I noticed this morning that a new version was listed on ProductHunt.

It's a crazy nice upgrade. It now have a number of themes plus an example theme as well as plugins and example plugin.

https://devdojo.com/wave

1 Comment
2024/10/28
18:18 UTC

7

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!

3 Comments
2024/10/28
07:00 UTC

5

Questions on HTTPlug and PSR-18 Compatibility and Asynchronous Limitations

I'm trying to understand the implications of transitioning from HTTPlug to PSR-18 in terms of design principles and functionality. Here are my questions:

  1. Has the HTTPlug specification become obsolete and been replaced by PSR-18?

  2. What is the benefit of recommending PSR-18 from a SOLID principles perspective?

  3. What is the relationship between Symfony HTTP Client and HTTPlug? Does this compatibility allow HTTPlug users to easily connect to Symfony’s HTTP client?

  4. PSR-18 doesn’t provide an abstraction for asynchronous requests, unlike HTTPlug. Could this be a limitation?

I'd appreciate any insights or explanations to help me better understand these points. Thank you!

3 Comments
2024/10/27
20:22 UTC

0

Build Laravel framework from scratch

Hey,

So I was looking for a course to build Laravel from scratch in order to understand better PHP and frameworks.

The only thing I found is this: https://www.youtube.com/watch?v=EU7PRmCpx-0&list=PLillGF-RfqbYhQsN5WMXy6VsDMKGadrJ-
From 7 years ago.

Do you guys know any updated course for this?

Thanks

11 Comments
2024/10/27
19:39 UTC

10

Parallel or multithread operations in php 8.xx

Hello all. In php 7.3 we had Pthreads, but time moves and now actual version of php is 8.3 as minimal. So as for windows only platform is there any actual way for, for example, read parts of file in parallel or work with very large array in several threads? The only solution I found is the fresh release of parallel extension v1.2.4, but It keep printing fatal error and shutdown my whole apache server even if I'm running example from manual(php 8.3.10 ZTS).

Maybe anyone of you already found any working solution and using it on your production? Very interest in that kind of stuff to solve my problem...

12 Comments
2024/10/27
10:06 UTC

23

I Used PHP and MySQL to Automate My Home Theatre

16 Comments
2024/10/27
00:38 UTC

42

Would you make a multiplayer backend in php for web games? Why or why not

I am wanting to make multiplayer games. Php is easy to use with MySQL and Ajax really brings things together to make it feel live. And you can easily do card games or games with 1-3 fps drawn animations. Like sand castle builder. I have brought the idea to other people. And they constantly sh*t on it. I just think html5, pygame, and other web alternatives just aren’t as easy as what multiplayer backed php game could be. What’s ur thoughts?

103 Comments
2024/10/27
00:11 UTC

31

Studying PHP - How many hours before Laravel?

So I started studying PHP.
How many hours should I invest before studying php?
At this moment I'm doing Laracast's PHP course, and I'm always asking ChatGPT to provide me best practices with each code I write.

Also,
If you have good places to learn from (project, best practices, etc) I would love to hear that!

56 Comments
2024/10/26
23:46 UTC

24

Introducing TryPHP a new tool to set up PHP on Linux with a simple curl command - looking feedback!

TLDR: I have created a tool to effortlessly set up PHP on Linux with a simple curl command available at: https://tryphp.dev

Hello everyone,

PHP is a beautiful language that has served millions of users, and its beauty lies in its simplicity. I still remember my early days on windows, installing wamp with just a few clicks, going to the c:\wamp\www folder, and creating a single index.php file with "echo 'hello world.';" that was all I needed to get started with PHP.

on linux, though, it’s not as straightforward, some might say it’s simpler than windows, while others find it more challenging. as a beginner I would say it's a bit challenging in a sense that you need to know what you're doing.

you need to add a repository, identify the necessary extensions, and install them alongside PHP. yes for seasoned developers, it’s a simple though still a repetitive process.

to make this process easier, i’ve created TryPHP a simple tool that automates these repetitive tasks on linux. it’s essentially a bash script that handles the PHP/Composer setup so you can jump straight into coding.

This project is a tribute to PHP and an attempt to gather community feedback to make it even better. i’d love to hear from talented people; any feedback is welcome.

Links: Tool: https://tryphp.dev Github: https://github.com/mhdcodes/tryphp

Roadmap:

  • add more presets (laravel, symfony, redis, lemp, etc.).
  • add support for php 8.4 once released.
  • add a customization page for installation, similar to ninite.
  • and more ...
68 Comments
2024/10/26
10:40 UTC

19

Fennec: An Early-Stage Oxidized Toolchain for PHP 🦊 🐘 🦀

17 Comments
2024/10/26
08:21 UTC

Back To Top