DEV Community

Cover image for Why PHP is Gaining Popularity in 2024: The Unexpected Comeback of a Classic Language

Why PHP is Gaining Popularity in 2024: The Unexpected Comeback of a Classic Language

Jenuel Oras Ganawed on October 09, 2024

PHP has been a cornerstone of web development for over two decades, powering millions of websites and web applications, including giants like Faceb...
Collapse
 
denys_bochko profile image
Denys Bochko

it could be so, but look at the job market. Only a small fraction on jobs are focused on php.

I just looked at the stats and it seems that php is dominating because of wordpress, which is understandable, easy to create websites.

When it comes to serious custom data, I believe other tech is being used. Don't get me wrong, i am a php dev, I am just looking at the trends and job market. There is about 10% of jobs that are asking for PHP and their salary is mediocre.

Collapse
 
jenueldev profile image
Jenuel Oras Ganawed

I totally see your point, and you're right—PHP does dominate in areas like WordPress, which makes sense given how easy it is to spin up websites with it. But I also agree that when it comes to more complex, custom applications, other tech stacks are getting a lot of attention.

The job market trends do show a shift, especially with technologies like Node.js, Python, and modern front-end frameworks gaining traction. As a fellow PHP dev, it’s tough to see that reflected in the number of job postings and, sometimes, even the salaries. But it's worth noting that PHP still dominates in many regions, especially in Asia, where it's widely used across industries. Laravel, for example, is still quite popular for building sophisticated apps.

It’ll be interesting to see how the demand evolves, though. Who knows, maybe PHP will get a resurgence in the future with newer use cases ☺️

Collapse
 
denys_bochko profile image
Denys Bochko

Honestly, nice response, I enjoyed reading it. You are completely right in each paragraph.

After 20 years in php I am adding more to the mix with Python and vue/react to have more options and be able to break the architecture into services.

I have very little experience with Laravel, I am using Yii2 framework, I like lighter frameworks. One of my biggest issues with laravel is that it includes a web service which is required to run it. it does not go well with me. It is a php framework, throw it on whatever server you need and run the site. But this is my own opinion.

again, love the response.

Thread Thread
 
jenueldev profile image
Jenuel Oras Ganawed

Thanks so much! I really appreciate your kind words—it’s great to hear you enjoyed the response. Best of luck to both of us as we continue evolving in our careers!

Thread Thread
 
realzendor profile image
Andreas Vent-Schmidt

"One of my biggest issues with Laravel is that it includes a web service which is required to run" - What required web service are you referring to? I assume you are talking about the "php artisan serve" command. This is not necessary, but only a facilitation during development.

Collapse
 
jenueldev profile image
Jenuel Oras Ganawed

Ah, I see! Here’s a revised response that reflects that perspective:

Thanks for your comment! You make a good point about the job market, but it’s interesting to see how PHP's popularity can vary by region. In some areas, especially where WordPress dominates, PHP is still very much in demand. However, I’ve noticed that PHP is also gaining traction in regions where frameworks like Laravel and Symfony are becoming more popular for custom development projects.

While it's true that certain tech stacks may be preferred for specific use cases, PHP’s modernization and performance improvements, especially with PHP 8, are helping it stay competitive. The demand for PHP developers might not always be as visible as for some other technologies, but I think it’s experiencing a resurgence in various parts of the world.

Collapse
 
rcls profile image
OssiDev • Edited

The way I see this, working at an IT consultancy, is bigger companies tend to shift toward something like microservice architecture, so the monolithic PHP apps usually get left behind because it's cumbersome to set it up to run in something like AWS Lambda or Azure Functions, because it's not natively supported. It's also not fast enough. Languages like Java, Python, JS and Go dominate in those areas. Where I've seen PHP is companies that have one monolithic app that they develop and sell. It doesn't require too many developers, and in too many places (sadly) those developers have already created quite a mess over 10+ years with the application so nobody wants to work on it.

Even now I work for a company that has hundreds of microservices running in AWS and they're finally deprecating the last of their PHP applications (which were a bit monolithic in nature) in favor of Golang on the back-end, and JavaScript with Vue.js on the front-end.

Collapse
 
eshimischi profile image
eshimischi

What do you mean by "laravel is that it includes a web service which is required"?

Collapse
 
denys_bochko profile image
Denys Bochko

The default installation of laravel includes a dev server, which you run to access the application.
It is good for new devs who don't know how to setup the local dev env to run a php application, but that makes laravel more bloated.

My opinion is that a framework is good when it is small and light and flexible to adapt more plugins, the ones that you need to use for a specific project.

Laravel has gone from being just a php framework to be a dev ecosystem, which is great for some projects. There is always a trade off, when more staff put into that system, it becomes slower, with more complex architecture and code there is more chance something can go wrong.

I am not discouraging anybody, just explaining my point of view, that's all.

Image description

Thread Thread
 
eshimischi profile image
eshimischi • Edited

The serve command is just a shortcut for the PHP Built-in Webserver php.net/manual/en/features.command..., something PHP has out of the box, so the point of using it is to start testing your application as fast as you could, you just need to install PHP, Composer and your application is up (if you don't need anything else, of course). But if you already have Nginx installed, there is no point at all, just use it. It's not wise to use the Builtin Webserver in production. So i see no issues here.

If you like small frameworks like Slim, Flight and etc - so use it. Yii 2, for instance, also gone beyond being just a simple PHP Framework, not to say about Yii3 which is already Production ready. It's all matter of what exactly you are trying to archive.

I spent 5+ years with Yii2 too but it's very much outdated now, they stopped investing in favor of 3rd version, even Alex Makarov said that already. Laravel on the other hand has very vast community and support not only from backenders, but also from frontend devs, so that's why it has a lot of tools/libs/integrations with modern stuff. So again it is matter of tasks.

Thread Thread
 
denys_bochko profile image
Denys Bochko

Absolutely.

Collapse
 
charles_roth_8c0df94d211a profile image
Charles Roth

I've worked with web frameworks with both PHP and Python... and for all the love there is of Python, setting up an efficient web server with a Python app (e.g. Flask) is still a royal PITA. The documentation (for actually running such apps on a server) is poor, unstandardized, inconsistent... and nobody seems to be in charge.

PHP, for all of its age, works efficiently out-of-the-box with the apache modules, and doesn't throw me any mysterious curve balls.

YMMV, of course. But if you know of really good server-setup-doc for Python/Flask/whatever, I'd love to hear about it. wchasroth@gmail.com.

Collapse
 
_aliraza profile image
Ali Raza • Edited

I agree, for python there is no well maintained guide for deploying apps, for me i just built my own production ready using following steps:

  1. Setup a VPS ( Lightsail, DigitalOcean etc )
  2. Setup git, nginx, certbot and db server ( depends if it's standalone db server or all in one app server )
  3. Pull the app, setup venv and install all packages, and env values
  4. Install gunicorn if not done already
  5. Setup a service for gunicorn using wsgi for my app
  6. Setup nginx site and point to my app/sock file
  7. Install the ssl cert
  8. Good to go

For Laravel/PHP apps, it's kind of similar as well but with PHP-FPM

Collapse
 
jenueldev profile image
Jenuel Oras Ganawed

I totally get where you're coming from! I’ve mostly worked with Python apps using FastAPI, and I found Uvicorn to be pretty straightforward for that setup, but I haven’t personally tried it with Flask. It could be worth looking into, though, since Uvicorn is an ASGI server and is generally efficient for handling async tasks.

That said, Python's web server setup can definitely feel more scattered compared to PHP's out-of-the-box efficiency with Apache. Documentation varies a lot between frameworks, so it’s easy to hit roadblocks. If you decide to give Uvicorn a shot, it might be a smoother experience, but I'd be interested to hear how it goes for Flask too!

Collapse
 
rslucena profile image
Rodrigo • Edited

PHP has been disappearing for years. Annual surveys of the most used languages ​​in the world have shown that PHP has been losing ground for some time now. It has never taken first place, but in recent years it has fallen from fourth, fifth place to tenth, fifteenth. I really like it, I have been using it for over fifteen years, but I had to remove it from my main language in order to continue evolving... not to mention the market, the market stopped asking for PHP about 5 years ago...

Collapse
 
jenueldev profile image
Jenuel Oras Ganawed

That's a valid point! The rise of PHP frameworks like Laravel, Symfony, and Yii has definitely shifted the landscape, leading many developers to rely on these tools rather than using PHP natively. While frameworks can enhance productivity and provide useful features, it might contribute to the perception that PHP itself is declining in popularity.

Collapse
 
rslucena profile image
Rodrigo

Well... the right thing to do would be for the language to expand as a framework grows (Laravel did this in the beginning, and did it very well), but the result became less about the language and more about the framework. I saw them do a good job for years, but today it is no longer a reference.

Collapse
 
agitator profile image
Andrew

Everywhere I look, some vendor or other is offering AI agents to assist with generating code. However, I don't really see that many AI tools targeting PHP. How many PHP and particularly Laravel developers out there are using AI assistants, I wonder?

Collapse
 
denys_bochko profile image
Denys Bochko

I believe most of the AI tools have php support. I am using Tabnine pro for that matter with Yii framework. There is Continue and Co-pilot.

I am switching to Python soon and I am very curious if Tabnine is going to work better on python than it did on PHP or is it just vscode problem.

AI assistants are good, but you need to know how to talk to them to get what you need. Lately it's been helping me a lot. It is good especially with small logical pieces that go over multiple lines of code, where there is a lot of typing.

I am using Yii framework, can't say about Laravel, not using it.

Collapse
 
jenueldev profile image
Jenuel Oras Ganawed

That's an interesting observation! While AI tools for languages like Python or JavaScript seem to dominate the conversation, there are still some useful AI assistants available for PHP and Laravel. Tools like GitHub Copilot, Codeium, Continue.dev, and even PHPStorm (which has AI-powered features through integrations) support PHP and can assist with code suggestions, refactoring, and error correction. Some Laravel developers are leveraging these tools to streamline repetitive tasks, generate boilerplate code, and enhance their overall workflow.

That said, it might not be as widely discussed because PHP is often seen as more "mature," with a lot of well-established patterns, libraries, and frameworks like Laravel that already optimize development processes. But I'd be curious to hear how many in the community are adopting AI assistants for their PHP projects too!

Collapse
 
phpartisanmakeweeb profile image
phpArtisanMakeWeeb

I use Laravel without AI Assistants. They are unnecessary.

Collapse
 
carcinocron profile image
carcinocron

I noticed TabbyML (selfhosted alternative to github copilot with local LLMs like starcoder) has much better completion with typescript than PHP.

Collapse
 
johanjanssens profile image
Johan Janssens

@jenueldev Might also wanna mention frankenphp.dev/ a PHP SAPI written in Go, which can be used as part of Caddy, or as a standalone Go package:pkg.go.dev/github.com/dunglas/fran...

PHP-FPM itself, it's pretty old school. It goes back to 2004 and was bundled with PHP in 5.3.3 release: php.net/archive/2010.php#id2010-07..., nearly 15 years ago.

Collapse
 
jenueldev profile image
Jenuel Oras Ganawed

Hey, thanks for the heads-up! This is actually my first time hearing about FrankenPHP—sounds really interesting! I’ll definitely check it out. It’s cool to see new innovations like this, especially with how old-school PHP-FPM is, as you mentioned. The fact that it’s been around since 2004 is wild, but it’s great to see tools like FrankenPHP potentially shaking things up for PHP devs. Appreciate the share!

Collapse
 
johanjanssens profile image
Johan Janssens • Edited

Most welcome, there are lots of things moving and shaking in PHP lately. Another project that is pushing PHP forward is: nativephp.com/ which tries to bring PHP to desktop.

If you have any questions about Franken feel free to reach out.

Collapse
 
carcinocron profile image
carcinocron

perceived performance issues

Interesting thing to note, PHP 5 was always slower than Java/C, but not slower than it's more direct competition (python/ruby).

As a typescript fan, hopefully PHP 8+ new type system features also lead to further performance upgrades.

Collapse
 
jenueldev profile image
Jenuel Oras Ganawed

That's a great point! PHP 5 definitely had its performance challenges compared to languages like Java or C, but it held its own against Python and Ruby. With PHP 8+, the improvements to the type system have been exciting. It's not only helping with better code quality but also seems to be contributing to performance enhancements, especially with JIT compilation.

As a TypeScript fan, I can totally understand the appeal of a strong type system. PHP is definitely moving in that direction, and it's great to see the language evolving to keep up with modern development needs. Hopefully, we'll continue to see both performance gains and improved developer experience as PHP continues to evolve!

Collapse
 
markwayne profile image
markwayne

Great article! I completely agree that PHP’s comeback in 2024 is a testament to its adaptability & modern feature set. The improvements in PHP 7 and 8 have definitely addressed the performance & scalability concerns that held it back in the past. The addition of JIT; union types; & attributes has made PHP much more competitive with languages like Python and JavaScript.

Collapse
 
jenueldev profile image
Jenuel Oras Ganawed

Thank you! I’m glad you enjoyed the article and I completely agree with your points. PHP has really made significant strides with versions 7 and 8, addressing many of the concerns developers had about performance and scalability. The introduction of JIT, union types, and attributes has brought PHP to a whole new level, making it competitive with other major languages like Python and JavaScript. It’s been amazing to see how PHP continues to evolve, and 2024 really feels like a strong comeback year for the language!

Collapse
 
eman1986 profile image
Ed Lomonaco

I feel like two other important things were missed, FrankenPHP is taking the PHP world by storm with it's amazing speed, and while Laravel is getting all the attention, I feel like Symfony needs to get some credit, after all they're the ones we have to thank for composer even existing, not only that their components are used on virtually everything a PHP developer touches (including Laravel).

This is not your father's PHP, the language is growing and advancing as all good languages do, I'm excited with what the future brings to this language, it's never been a better time to learn and use PHP.

Collapse
 
jenueldev profile image
Jenuel Oras Ganawed

Thank you for your thoughtful comment! You’re absolutely right—FrankenPHP has been generating a lot of buzz lately, and its speed is definitely something that deserves attention. As for Symfony, I completely agree. While Laravel often gets the spotlight, Symfony has been the backbone for many innovations in the PHP ecosystem. Composer, which revolutionized dependency management in PHP, and the wide use of Symfony components in frameworks like Laravel, are perfect examples of its far-reaching influence.

PHP really has evolved into a powerful, modern language. With new tools and frameworks pushing the boundaries, it’s an exciting time for developers. I’m glad you share the same enthusiasm for where PHP is headed, and I appreciate your insights!

Collapse
 
eshimischi profile image
eshimischi • Edited

There is no “unexpected comeback”, because there was no any step back in the first place. You may hate PHP but still it is the base of modern Internet.

Collapse
 
mexikode profile image
MexiKode ⚙

reject modernity embrace tradition
Image description

Collapse
 
mexikode profile image
MexiKode ⚙

thanks to HTMX, and humongous bloat of laravel devs now start to write vanilla PHP

Collapse
 
wlcdesigns profile image
wLc

“Don’t call it a comeback! I’ve been here for years…” - LL Cool J

Collapse
 
martinbaun profile image
Martin Baun

I think it still makes perfect sense to learn PHP, even in 2024. A decent chunk of all web services are written in PHP and companies need skilled devs to maintain them.

Collapse
 
jenueldev profile image
Jenuel Oras Ganawed

I completely agree! PHP is still a major player in web development, and a huge number of websites and services are built with it. Even in 2024, learning PHP makes a lot of sense, especially since companies need skilled developers to maintain and modernize their existing systems. Plus, with the advancements in PHP 8 and frameworks like Laravel, it’s not just about maintaining legacy code—it’s also about building new, modern applications. PHP's long-standing presence in the industry means that it’s likely to remain relevant for years to come.

Collapse
 
valvonvorn profile image
val von vorn

"Game-Changing" is even worse a buzz word than "AI" lols :D XD
what's wrong with you marketing guys, are you leveraging AI to delve into the depths of making inflated language even more pompous?

Collapse
 
ngozi_chris_7dafa1bd8abd4 profile image
Ngozi Chris

As a beginner, I am learning a lot here. I also learn from other authority sites like peerwallet.com/doc/blog