News for hackers. Stuff that matters.
Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by claudiulodro on Friday May 05, 2017 @03:49PM (#14276300)
#1 reason the article doesn't mention: It's incredibly cheap to host PHP. Hosting companies push WordPress and other PHP-based hosting heavily and make it super easy for anyone to get a live site going with PHP.

Last time I launched a node app, it took me a full day of messing about in AWS. Last time I launched a PHP app, it took me less than a half hour at Siteground.

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by helenakyso on Friday May 05, 2017 @05:41PM (#14277028)
Try now (https://zeit.co/now), I use it and it is very easy to deploy a node.js app. You literally just type `now` in your terminal.
Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by vec on Friday May 05, 2017 @06:40PM (#14277329)
> in your terminal

You just lost a nontrivial percentage of PHP developers. Far and away the most compelling feature of PHP for a lot of their target audience is that the deploy model is "unzip this file in that folder". If I want to host my own web site but I don't want to "learn to program" there is no alternative.

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by merb on Friday May 05, 2017 @06:45PM (#14277365)
> unzip this file in that folder

it's more like "copy these files via ftp to this host" (p.s. that also includes your config.php with plain text passwords of course)

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by wolfgang42 on Friday May 05, 2017 @09:39PM (#14278192)
The problem with the "copy these files" approach, even more than dealing with FTP, is that the upgrade process winds up being "copy these files, but be careful not to overwrite any changes you made". Applications like WordPress or Piwik come with a self-updater, but then you wind up with having to fiddle with the permissions to let the application overwrite itself.

I got fed up with this a few years ago and started building http://bitmash.io (yes, shameless plug) which does some fancy filesystem manipulation to swap out the application's files during upgrades while otherwise looking like a perfectly ordinary PHP hosting provider. While I'm proud of this solution it still seems rather silly to have to jump through these sorts of hoops to handle deploys.

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by developer2 on Friday May 05, 2017 @11:56PM (#14278586)
>> Applications like WordPress or Piwik come with a self-updater, but then you wind up with having to fiddle with the permissions to let the application overwrite itself

Tell me about it! It took me an entire day to figure out how to configure a WordPress install in order to allow it to self-update (without ftp). To do it by only granting owner and/or group write permissions, you have to figure out that you need to modify wp-config.php to define the "FS_METHOD" constant with the value "direct". Without this, WordPress code tries to be super clever with its umask settings, which only makes things worse.

It quite literally took an entire day to set up WordPress to self update. It's easy if you chmod 0777 nuke the entire install, but extremely complicated to set up with acceptable filesystem permissions. WordPress is designed to be sloppily dropped in a webroot, not to be installed by intermediate users who care about security. Well, as "secure" as WordPress can be. And to be honest, the most secure WordPress installation would be incapable of self-updating, as you're granting the web user write access to the entire installation - not just for updates, but for any vulnerability.

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by deckiedan on Saturday May 06, 2017 @03:29AM (#14279163)
Use two users, and wp-cli. I've been doing this for years now. Php runs as a less privileged user, without​ write permission. If they want to install plugins, they need to enter the FTP name and password of the site dir owner user. Since the FTP connection is localhost, no passwords go over the wire in plaintext. Next, you install wp-cli, and add a real system cron job to 'wp core update', and 'wp plugins update' every hour. You can also do things like transient cleaning once a month, or whatever else, and running the WordPress fake cron.

You can then disable wp cron, which saves network resources.

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by developer2 on Saturday May 06, 2017 @08:47PM (#14283197)
Personally I find ftp as an unacceptable protocol for this purpose. Doesn't matter that it's localhost. It just goes to show WordPress is truly aimed at the lowest common denominator.
Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by wolfgang42 on Saturday May 06, 2017 @12:53PM (#14281135)
The fact that doing a filesystem-level end run around is simpler and more reliable boggles my mind. When I started experimenting with it I thought "this will never work, there's all sorts of things that can go wrong" but I eventually wound up migrating all of my PHP-based applications (WordPress, Piwik, and PMWiki) to it because it was so much easier to work with (even with maintaining the control software) than doing it the standard way.
Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by vec on Friday May 05, 2017 @06:51PM (#14277398)
Well, yeah. Point being that if I'm used to working with .doc and .xls files there's next to zero new skills I have to learn and nothing that really pulls me out of my comfort zone. I just have to install a text editor ("like Word, but for .php files") and an FTP client ("type this magic string to set it up, then it's just a funny looking file browser") and I'm off to the races.
Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by anshumanravi on Saturday May 06, 2017 @01:29AM (#14278850)
A lot of things happened in php world,since you last checked, which is apparently ~ 5 years back. for starters go read about Magento 2 codebase and its code organization and deployment strategy. Whether you do FTP based file deployment or sophisticated CI/CD build, it all depends on developer not programming language you are using.
Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by moomin on Friday May 05, 2017 @04:57PM (#14276791)
TBH, PHP is viable for pretty much exactly as long as Wordpress survives and uses it. If that changed, I wouldn't fancy PHPs chances.
Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by paulgrimes1 on Friday May 05, 2017 @07:42PM (#14277656)
I disagree. I've been using PHP for about eleven years now, even since the bad old days of PHP3, and I have never used, and generally advise against using, wordpress. PHP will be around long after wordpress.

I do concede that if PHP went away, WP would somehow survive, like some kind of post-nuclear cockroach.

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by exclusiv on Saturday May 06, 2017 @01:52AM (#14278921)
I'm in the same boat. I cranked a lot of things out with CodeIgniter back in the day. Expression Engine is superior to WordPress but if you like either I'd suggest Craft CMS now and moving forward. For general apps, I use Laravel or Lumen. And React PHP for scraping. And don't forget The League [1]. Lots of great PHP stuff out there.

[1] https://thephpleague.com

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by Daishiman on Friday May 05, 2017 @06:18PM (#14277208)
The vast majority of web sites run PHP for better or worse and that code ain't going nowhere.

The performance characteristics of Node are completely irrelevant for most sites. The developments model's inherent complexity and the moving target, however, matters very much.

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by camus2 on Saturday May 06, 2017 @01:41AM (#14278881)
> The vast majority of web sites run PHP for better or worse and that code ain't going nowhere.

The vast majority of blogs that are build in Wordpress. Remove all the blogs and corporate websites and I bet that's not the case anymore.

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by Daishiman on Saturday May 06, 2017 @08:52AM (#14280016)
You're saying that as if blogs and corporate websites weren't a humongous proportion of the internet.

And no, there's some pretty big, modern sites like Mailchimp which run on PHP.

There's literally no reason to use Node if you already have an effective backend with PHP because Node doesn't really bring anything new on the table, but it does bring along its own class of issues.

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by camus2 on Saturday May 06, 2017 @09:18AM (#14280101)
> because Node doesn't really bring anything new on the table

You can't write a production grade web socket server in PHP. and no ReactPHP isn't my definition of production grade. If your app is real time you just can't use PHP for that.

So yes, Node brings something new to the table.

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by Daishiman on Saturday May 06, 2017 @02:21PM (#14281573)
Which is trivially compartmentalized through a Node proxy server that takes up at most 1000 lines of code. Nobody's throwing out their code for that.
Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by camus2 on Saturday May 06, 2017 @03:39PM (#14281876)
> Which is trivially compartmentalized through a Node proxy server that takes up at most 1000 lines of code. Nobody's throwing out their code for that.

You just said, Node brought nothing new to the table, obviously you were wrong.

Re:PHP vs Node js... Let's be honest: Node.js couldn't kill ... by clubminsk on Friday May 05, 2017 @04:25PM (#14276583)
exactly!