I automated my home theatre with it as seen here: 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.
PS. Sweet home theatre setup!
Try Typescript in your next project.
I have a PHP app written in PHP5.6, for my own use (not exposed on the internet). Naturally it broke when I upgraded to Debian Buster. Upgrading the code would have taken ages; but it took me just a day or so to work out how to get PHP5.6 working on Buster.
I've retired, because I can, and because I prefer not to work if I don't have to. There's a pretty steep learning curve from PHP5 to PHP8; I don't want to do that learning, if it's no longer necessary for my job, and I'm only using it for a private app.
I've not used PHP8 on anything serious, but my impression is that it's a HUGE improvement on PHP5. It's a lot more coherent, a lot faster, and a lot more secure. A lot of what has been dropped was dropped because it was insecure crap - it had to go sooner or later. In the end it was "better late than never".
For what it's worth, there are a couple of tools out there that should help getting your personal app up and running on PHP7 if you're interested in doing that at some point. Most of the breaking changes I've run into are because deprecated features were removed, which in a lot of cases seemed like strange/wrong syntax to me anyway.
I have a legacy app that can't feasibly be updated past 5.6 because it uses a totally undocumented framework that wasn't built in-house. While I could run one of the tools I mentioned, 99% of the framework code probably never runs so there would be a lot of work done for nothing.
I'm deeply interested in your project as I have a similar goal. I would also like to create my own custom entertainment setup, throwing in commercials/trailers with feature presentations. Do you have a website or place I can reach out to you with questions?
Or for Hacker News readers, if I want to create a similar custom media playlist kind of thing, is it possible to do that with VLC or would I have to write a custom solution?
Maybe one day I'd like to re-write it with everything I've learnt so I can compile it and monetize it.
I've also thought about open sourcing it, but the code is a little rough (messy) as-is and I struggle with what to do.
I know JavaScript and PHP, and PHP just seemed to do everything I needed.
I built a website a long time ago for collaborative music composition. It interacted with command line software and used XMPP to communicate with the server.
That sorta lead to using PHP to control everything in the theatre, plus a lot of the components I bought can be controlled through HTTP commands.
Overall, this was a side-project and I've slowly perfected the timing and the features over the past six years to where I have it pretty feature complete and reliable now.
Everything is timed perfectly, it can handle intermissions, overtures, and exit music. If there's some sort of break down, it shows film melting, shuts off the projector, and brings the lights up... Stuff like that.
As for VLC: This all runs on a Raspberry Pi 4. I originally used VLC but started having trouble with it when I moved from the Odroid XU4 to the Pi, so now it runs on mpv.
Moved to the Pi because I wanted to run Netflix in the theatre easily as well. If the Odroid ran Netflix (and some other small things), I'd prefer it.
It's the people saying "PHP is the best language for building web apps in 2021" that are problematic.
No. It's simply not. We have come a long way since then and that view point can only be held out of ignorance.
That isn't to say you can't build awesome stuff in PHP, you can and in your case did.
But to say PHP > Java/C#/Rust/Elixir/etc is just being an edgelord for the sake of it. Language tech improved, PHP didn't come with it. That is fine, C didn't come with it either but it still has it's place.
Right tool right job, PHP can still be the right choice for lots of things if you have experience with it and can use it to make the thing you want.
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.
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.
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.
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.
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 [2] http://modpython.org/
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.
This isn't disagreeing with you, just saying that it is this way for cultural rather than technical reasons.
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.
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-pr...
I wish PHP.net could get some support to provide official repos of their own. It would make upgrading easier.
[1] https://www.stackscale.com/blog/php-fpm-high-traffic-website...
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.
As of writing, at least, no one here is attacking your language.
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.
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".
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.
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.
Symfony/Laravel PHP is basically like any other language, you could use Ruby with Rails, Python with Django, Java with Spring, Elixir with Phoenix and it's basically the same ballpark. But you give up the simplicity of setup and deployment.
XAMP PHP, on the other hand, is probably one of the most accessible way to do web programming, but isn't the same at all as Django, Rails or even Symfony/Laravel.
You use the same language, sure, but the two are very different beasts. You could probably add a third with the world of PHP-based CMS, like wordpress or drupal.
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.
> ... 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.
It's maddening what's needed to deploy code for other web languages.
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.