11 ms·
78% of the Web Powered by PHP
- mattl 5y agoPHP 7.4 isn’t even available in Ubuntu 18.04 LTS without a third party repo. I wish PHP.net could get some support to provide official repos of their own. It would make upgrading easier.
- warp 5y agoIf you want newer software, why not upgrade to Ubuntu 20.04 LTS or even just the latest Ubuntu?
- mattl 5y agoI mostly run 20.04 or 18.04 with the repo. But a lot of people won’t upgrade or use a third party repo.
- jedisct1 5y ago“LTS” means “stuck with obsolete software”.
- thomaslord 5y agoI absolutely think Ubuntu's update cycle is a big part of why PHP 8 doesn't have a higher adoption rate. The PHP webapps I write are all served by Ubuntu servers (on 20.04 LTS) and there isn't an official PHP 8 package yet. Even if you're running 21.04, PHP 8 still isn't available as an official package. Ubuntu 21.10 was just released and finally shipped PHP 8 packages, and PHP 7.4 support ends in roughly a month. Anyone sticking strictly to LTS releases won't get official PHP 8 support until ~5 months after PHP 7.4 support ends.
- anf0 5y agoProbably due in large part to WordPress
- egeozcan 5y agoWordPress is the Excel of Web Development. Especially when people keep building complicated flows with it, for which it was not designed for. OTOH, the UI is known by everyone and is intuitive, so from a users perspective "it just works", and "you can do these advanced stuff if you learn scripting a bit". Many projects explicitly look for freelance WordPress developers, it's a huge market and I respect it deeply, but I'm glad my career put me in a position where I can totally ignore it.
- EGreg 5y agoExactly. But Wordpress has been a resounding success because there is such a demand to own your data, brand and relationships. To have CONTROL over your own site and choice in hosting. There has to be something like Wordpress for Web 2.0, so we can break the oligopoly of Facebook, LinkedIn, et al. and move the world from digital Feudalism to a Free Market: https://qbix.com/blog/2021/01/15/open-source-communities/ https://qbix.com/blog/2021/01/15/open-source-communities/
- dageshi 5y agoI think it's because many websites are incrementally built on. It's a case of tacking on this extra bit of complicated functionality vs rebuilding the entire site from scratch and migrating existing content to it in a new tool.
- akudha 5y agoMost businesses care about getting stuff done and making money, not about the merits of the tools being used. In one financial firm where I worked, they were using Excel for running financial models (I am not making this up). It will often crash, users constantly complained - but when I offered to rewrite their models using databases and a programming language, I was instantly shot down. They didn't want to touch a system that has been working for a while, even with all of its problems. So they stuck with Excel, even when they had access to a programmer. Programmers can laugh all they want at Excel, Wordpress, PHP etc - but these are tools that get stuff done quickly and make businesses a ton of money. So businesses will continue to use them, even if there are much superior tools around.
- zmw 5y agoThis dubious 78% statistic has been discussed to death in https://news.ycombinator.com/item?id=28510520 https://news.ycombinator.com/item?id=28510520. The submitted title is badly editorialized and leaves out the actual point of the article: only "1% on PHP 8" despite a whopping 78% total, if we take the dubious statistic at face value. For the record, the submitted title is "78% of the Web Powered by PHP" at the time of this comment.
- reilly3000 5y agoIf you look at the web by urls not weighted by traffic, you’ll come across the unfathomably large swath of autogenerated spam blogs. For every legitimate business in the world there are 100 people trying to ‘make money online’ paying for scripts that register and post spun content on thousands of domains. The long tail of the internet is an absolute wasteland. It’s tech choices should have little bearing on the rest of us.
- nonameiguess 5y agoYes, thank you. The site's methodology disclaimer explains this is the percentage of sites for which they could automatically determine the language in use on the server. Newer web languages don't include a header telling you the language and version in use at all, and if web frameworks add one, security auditors will always make you remove it. So the real statistic is 78% of websites that are written in a dynamic scripting language, don't get pen-tested, or don't care about security, are written in PHP. That's a very different statistic than 78% of all servers that will respond to an HTTP request.
- TrispusAttucks 5y agoTo be fair [1] 8.0 is less than a year old. It's also a bit unwise to jump right into a point zero release when you could wait for point one release with more of the bugs ironed out. 8.1 just hit RC4 [2] five days ago. I'd say after the final RC is approved we will start to see an increase in PHP 8 usage. Even more so after Ubuntu 22.04 LTS release. [1] https://www.php.net/archive/2020.php#2020-11-26-3 https://www.php.net/archive/2020.php#2020-11-26-3 [2] https://www.php.net/archive/2021.php#2021-10-14-1 https://www.php.net/archive/2021.php#2021-10-14-1
- jedisct1 5y agoPHP’s popularity is not only due to Wordpress. The language is simple and accessible. The ecosystem and community are ginormous. Are you stuck on something? A quick Google search has the answer. Finding PHP developers anywhere is also easy. It’s fast. No, really. And keeps getting faster. It’s easy to run directly on your local dev environment. It’s boring in a good way. Evolution is incremental. Breaking changes happen, but nothing unmanageable, and every version is supported for a long time. There’s not a ton of confusing options to choose from, with the risk that they will eventually become obsolete/un maintained. Laravel and Symfony are pretty damn good. Need to get something done quickly, just for a prototype? PHP ‘s a good choice. You will get there quickly, even if the code is not something you’ll want to show off with. Need to choose a language for a web application that need to be maintained long-term? PHP is not a bad choice either, for all the reasons mentioned above.
- jpgvm 5y agoEverything you say is also true for Java or Kotlin, which are better languages and have even better backwards compatibility story. You also left out all the downsides of PHP so it looks more flattering than it should. So while PHP is ok, why choose PHP when you can choose Java/Kotlin? The only benefit of PHP over Java/JVM-langs is probably memory usage, which is generally not that important of a factor in today's environment where memory is cheap and devs are expensive. I think unless you are already super familiar with PHP it's probably not the ideal choice. You could do worse, but you can also do better with Java/Kotlin/C# all of which have the good parts of PHP but none of it's bad parts, higher quality ecosystem, higher quality devs, better tools, faster runtime, etc.
- dncornholio 5y agoBetter is highly subjective, especially in this case. Also, why would you distinguish Java/Kotlin/C# as something different then PHP? Java/Kotlin/C#/PHP they all mean the same to me. They're programming languages..
- jpgvm 5y ago
- osrec 5y agoI don't care about the negativity around PHP (often from JS developers, which has its own quirks and pitfalls). PHP is a language that gets stuff done, and if you're a good PHP developer, you can put together some beautiful code with a language that many people consider ugly. I'm sticking with PHP for the foreseeable future. As far as my use cases are concerned, it's a brilliant tool for the job.
- brightball 5y agoThe first half of my career was heavy PHP and it helped make me into who I am today. I’ve barely touched it in the last 10 years, but the people who give PHP a hard time are largely misguided. Last time I wrote about this it got some circulation so I’ll repost here. https://www.brightball.com/articles/no-such-thing-as-real-programming https://www.brightball.com/articles/no-such-thing-as-real-pr...
- throwaway894345 5y agoPHP was my first language, but back in 2008 it was a real mess. Not only was performance based, but there wasn’t a package system if I recall correctly and everything was just in the standard library prelude namespace. The names were also really poorly standardized and optimized for keystrokes rather than readability. Security issues were abundant across the ecosystem, and everything ran slowly. Most importantly though, everything in the ecosystem intended for it to be used as a templating language like Jinja—little bits of PHP sprinkled amid a sea of HTML tags. I remember learning Java and Python and feeling so blown away because they weren’t doing this strange inside-out template programming—they would define webserver handlers and generally decouple the application logic from the HTML. I’m staunchly of the opinion that 2008 PHP was a hot mess, but also that not long before it was the easiest path toward a functional web application. I’m sure a lot has changed in the intervening years, especially considering Facebook’s heavy investment, but nevertheless I understand why it was so heavily criticized by people who used it back then.
- TrispusAttucks 5y agoThat was indeed a rough time for the language. A big part of that, I think, was the setbacks around the [1] PHP 6 debacle. [1] https://ma.ttias.be/php6-missing-version-number/ https://ma.ttias.be/php6-missing-version-number/
- Zababa 5y agoSince this article is about when to upgrade depending on your language, I'd like to know if there is a place with information about languages/ecosystems by "longevity", which could be time before you have to upgrade your language, time before you have to upgrade your packages, or something like that. Of course this would be a complex measure. For example, having to upgrade the language AND change code would be worse than having to upgrade the language and don't change code. Same thing for dependencies. For example, Go has strong backwards compatibility guarantees, but the last supported versions is less than a year old (1.16.9). PHP's security support of 7.3 ends in a bit more than a month, for a total of 3 years of support. Node.js is a bit younger but will still have 3 years of support. Java 8 still has extended support until 2030 by Oracle. There are also things like, with PHP, you may just have to change the environment, but with Go, you would have to recompile the code. Maybe this could be better expressed as a "maintenance cost" or "churn"? I often hear that "ecosystem X has a lot of churn", but often it's not really well justified. For example, frontend JS moves a lot, but backend JS seem to have been "stuck" on Express for quite some time, and Express itself seems stable, if a bit dated. Maybe that's because we only hear about people changing code, frameworks, best practices? I don't see a lot of articles like "my 5 years old codebase is pretty much the same as when I began", compared to "I switched from X to Y".
- captn3m0 5y agoNot exactly this, but we track EoL dates of almost every mainstream languages along with their release cycles (and compatibility guarantees, if any) at https://endoflife.date https://endoflife.date
- Zababa 5y agoThat's actually what I used as a reference for a few parts of my comment, that's a nice coincidence. Since it's open source, I was wondering if a compare tool would be in the scope of the project?
- captn3m0 5y agoWe have an API, I think that’s something that should be doable with it. Do create a discussion on GitHub though - would love to discuss this more.
- thrusong 5y agoI don't care what anyone says— I absolutely love PHP. I automated my home theatre with it as seen here: https://www.youtube.com/watch?v=Cc8K6lg7Ag8 https://www.youtube.com/watch?v=Cc8K6lg7Ag8 I built a website just for me so I can stream my movie collection anywhere I go, but it also has a button to start playing an automated show in my theatre. I call it the Phantom. When you start a show, it plays a Dolby ad, a dancing hot dog-style vintage drive-in ad, and several random trailers in the same genre before the feature. The Phantom PHP code controls the lights, projector, curtain, and sound system. The lights come up for the credits and the whole room goes to sleep 30 minutes after the presentation. I've only shared it once here before and someone, I'm guessing a PHP hater, gave it a thumbs down on YouTube. PHP is extremely powerful in my experience and has been very lucrative in my career. One of the best things I ever did was learn how to program with it.
- TrispusAttucks 5y agoAgreed. Ignore the haters. PHP is a silent giant that is hugely under-rated. While it is a perfect fit for the web, it is also an excellent general purpose scripting language for things that can traditional be done with bash. PS. Sweet home theatre setup!
- thrusong 5y agoThank you! Not ironically— another thumbs down. All some people have to offer this world is negativity. I feel sorry for them.
- ashitlerferad 5y agoAlso, HN removed it from the front page despite the upvotes. After, November 28 it may be more worthy
- IshKebab 5y agoI've done a bit of PHP and it is not under-rated. Compared to most other languages it is terrible. Nobody is saying that you can't make cool stuff with it. Try Typescript in your next project.
- protomyth 5y agoPHP is one of the easiest language to install on Apache and later web servers. It is also a no brainer to install software written in PHP on those servers. It is a wonder why other language implementors haven't looked at doing the same thing.
- TrispusAttucks 5y agoUsing the [1] PHP-FPM is also a popular (preferred?) way of running PHP whilst not relying on an embedded module and being HTTP server agnostic. [1] https://www.stackscale.com/blog/php-fpm-high-traffic-websites/#What_is_PHP-FPM_and_its_features https://www.stackscale.com/blog/php-fpm-high-traffic-website...
- uranusjr 5y agoBecause it’s out of the language implementors’ hands. Support in Apache, for example, requires Apache to be compiled with certain configuration, so if big Apache distributors don’t compile with support to your language, there’s nothing a language implementor can do to help. It’s like asking why Ruby doesn’t work harder to make itself included by Windows—I’m pretty sure the maintainers wouldn’t object, but they don’t have a say on that anyway.
- protomyth 5y agoThat's not quite right. The PHP implementation doesn't require Apache to do anything special for them. Apache had modules and other servers had things like FastCGI.
- throwaway894345 5y agoI usually work with Go, and it seems a lot nicer just to let it listen on a socket perhaps with Nginx in front of it. Having to install a guest application onto a webserver program has always seemed silly to me.
- xyz11 5y agoPHP is widely used because it is easy to use. In contrast with other programming languages that are complex, PHP is simple, fluent, clean and organized, hence it is a boon for the new users. PHP has a well-organized syntax which is logical at the same time
- fennecfoxen 5y agoWhat does it say about things when about an hour after the article is posted we have two thread discussing the upgrade question that is central to the article, one drawing attention to the limitations of the methodology, and like five evangelizing with words like “I don’t care what the haters think, I love PHP?” As of writing, at least, no one here is attacking your language.
- skrowl 5y agolol 78% of total URLs, including parked domains on camper sites. So you have to count a parked domain page the same weight as youtube.com to get to 78%
- tommek4077 5y agoAnd yet, Slack, Etsy, Wikipedia, WordPress, Mailchimp, Canva, Indeed, Investing.com are using PHP. I would think Wikipedia is a worthy competitor to youtube in this regard.
- fbn79 5y agoI suspect the success of PHP is binded to the success of BBOM architecture (http://www.laputan.org/mud/ http://www.laputan.org/mud/)
- dncornholio 5y agoI counter that PHP could have been bigger if it wasn't because of all the BBOM stuff. I'm sure it scared away the OG devs in those days, thinking PHP wasnt worth their time.
- skizm 5y agoPHP wins because you can write a few lines of code in single file, shit it into an apache folder, and you have a fully functional front and backend of a web app. There is no other web framework / language that is easier to get started with. I've always had this dream of writing something like "PyHP" which was the same thing, except you put python files into an nginx folder and anything sent to stdout is sent to the browser, but I've never gotten around to it. Would love if someone made this.
- ksec 5y ago>I've always had this dream of writing something like "PyHP" Similar here, Something Ruby-PHP. But even PyHP will do for me. I think the problem is PHP was designed by someone who just want to get shit done and absolutely dreaded programming. Versus programmers who just wanted to create a beautiful programming language.
- sanderjd 5y agoI was able to do this with erb (ruby templating language) very similarly to php scripts eons ago. It just never caught on to do it that way for other languages because php already had that market sewn up. This isn't disagreeing with you, just saying that it is this way for cultural rather than technical reasons.
- m000 5y agoThey made it a long time ago. It's called CGI [1]. Seriously, there's no inherent PHP advantage so you have to build something new. It is only that Apache package maintainers started shipping a mod_php package that required almost zero configuration to get up and running. Then every other web server followed suit. On the other hand, alternatives for other languages were either slow (i.e. CGI-based) or harder to configure (e.g. mod_python [2]). [1] https://docs.python.org/3/library/cgi.html https://docs.python.org/3/library/cgi.html [2] http://modpython.org/ http://modpython.org/
- tiffanyh 5y agoNo tooling needed to deploy code is a massive contributing factor to PHP success. It's maddening what's needed to deploy code for other web languages.
- jpgvm 5y agoMost good languages are self-hosting with little/no dependencies. Where you run into trouble is the scripting languages, i.e Node.js/Ruby/Python. You are best off avoiding these if don't like deployment nightmares.
- ThinkBeat 5y agoPHP is in my opinion the best solution when creating libre open-source software It gives the widest amount of people the chance to selfhost for cheap. You can get a PHP webhost for $5 per month including databases, some cheaper, some more expensive. You dont have to worry about a VPS, Docker, Kubernetes, or anything like that. Hosting companies contribute by having "one click installs" Sign up, pay you bill, click a button and you have your very own Wordpress instance and you can publish what you want. If you create solutions that you want people to be able to self-host it is the best choice for now. It is far from perfect. WP has suffered a long string of severe security bugs. People have gotten their sites hacked Some cheap hosters are not good. (I had great experience with a couple) A lot of devs like to hate PHP and see it something awful from two decades ago. I understand that. There is truth in it. PHP from 20 years ago is quite different from PHP now. It is probably better than you think. I would not start a project that needs to Google scale on PHP. Nor would I expect a lot of people to have the ability to cheaply and easily self-host something like that. but I like running my own Wordpress, my own file share solution, my own wiki and so on. I can do all that dirt cheap thanks to awesome developers, PHP and cheap hosting.
- ashitlerferad 5y agoYet HN removed from the front page. Why the hate for PHP.
- hsbauauvhabzb 5y agoSecurity consultant who audits web applications. I’ve achieved many web shells over the years, the majority (80%) were in php. I’ve never seen an exploitable sql injection vector in anything but php. When I make recommendations, they’re generally level headed somewhere between fix this, fix all instances of this, or just start from scratch. Php often receives the latter, and not purely on its language merits alone - my last php report was 150 pages due to frameworkless insanity resulting in vulnerabilities in almost every facet of the system (I literally got all top 10 owasp in a single app). I don’t know what it is about php, maybe it’s the low bar to entry or lack of unit tests, but something about the languages just results in vulnerable code.
- oliwarner 5y agoJeez, people, it's right there in the opening line. > ... whose server-side programming language we know How many of all the websites advertise their server language accurately? Everything else I've used in the past decade does not. This seems to pop up on HN on a regular basis. I'm no fan of PHP (I've done my time thanks) but while I can't deny the popularity, these posts speak more to its users' insecurity than anything else. In short: who cares? But judging by the comments, far too many people.
- cudgy 5y agoPHP == “The COBOL of the web”