/r/PHP
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
Sometimes you may want to extend some Laravel classes, such as the Stringable class. One way to do this is through macros or mixins. I wrote an article about how you can use them and how they work under the hood 🙌
https://blog.oussama-mater.tech/laravel-a-little-bit-of-macros/
Right now I'm mostly using Laravel Forge + AWS for all my projects.
It's super convenient, easy to deploy, and mantain, but think I can save a lot of money by using my own VPS.
ls there any real easy way to deploy a maintain multiple projects on my own VPS?
Have someone tried coolify.io for deploying Laravel/PHP apps? Is there something better?
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 ?
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?
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.
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.
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.
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 ?
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/
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.
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?
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?
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
I am confused between REST API vs Microservices usage on this approach and if someone could guide would be helpful.
Thanks
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
Please, check the link below. Thank you so much for your recommendations.
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.
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!
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:
Has the HTTPlug specification become obsolete and been replaced by PSR-18?
What is the benefit of recommending PSR-18 from a SOLID principles perspective?
What is the relationship between Symfony HTTP Client and HTTPlug? Does this compatibility allow HTTPlug users to easily connect to Symfony’s HTTP client?
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!
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
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...
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?
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!
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: