I am trying to learn the backend technology but I don't know which one I should go with. I am a fan of ReactJS for front-end.
Without doubt, Node.js is the fast and simple solution for building RESTFul or GraphQL. Many professional tools for you: Restify, Fastify, graphql-tools, etc with them you can get it works after several steps.
Node.js is simple to set up and allows you to focus on and optimize your usage of a single language; namely Javascript.
You can get started with learning this on your local machine without setting up a dedicated server. Once you're ready to test it out in the wild you can either go with a serverless option, which charges you on a per operation basis, or you can procure a VPS, which is safer financially, but then you'll have to be sure to set up the firewall (ufw is simple to use) and reverse proxy server (I'm fond of NGINX) correctly. There are a few other security measures to be taken as well, such as fail2ban and configuring sshd.
This seems like a decent guide to get started on that aspect.
As others have said, PHP just "being available" on EVERY webhost, and the royal pain in the ass it is for normal "Joe Sixpack" site owners to even get node.js on their hosting guts ANY argument about node.js being somehow magically "easier".
NOT that it is in a 1-up comparison anyways. If you can't handle the minor differences in syntactic sugar, you probably shouldn't be writing websites anyways since both PHP and JavaScript are little more than C tarted up in a frilly dress -- the only REAL language difference is the shade of lipstick and the size of the breast implants.
THAT SAID, you mention react -- which to my mind means if you're looking at server-side hosting technologies you aren't qualified to choose one. This is because the moment actual server side development is involved you are talking about making a WEBSITE -- and bloated train wrecks of scripttardery like react, like angular, are walking talking WCAG violations.
MAYBE it's because my freelance work consists almost entirely of bailing companies, banks, healthcare and government organizations OUT of fines and civil litigation for accessibility failings (yes, you CAN be fined or sued in some countries for this. See the US ADA, the UK EQA, etc) but scripting heavy garbage like that almost always results in inaccessible websites that are a giant middle finger to large swaths of users for ACTIVELY encouraging you to build websites that don't work scripting off.
... so if you are using those by choice in building your sites, you aren't qualified to be building websites.
If you are "building your user interface" with JAVASCRIPT, and we're talking about a WEBSITE, you ****ed up!!! That's NOT JavaScripts ***ing job on a website!!!
Content of value, marked up semantically, styled and layout in CSS, enhanced with JavaScript as desired so long as said scripting gracefully degrades. THAT IS DESIGN! Anything else is incompetent nonsense. Remember the unwritten rule of JavaScript when it comes to building a website:
If you cannot build a fully functional website without JavaScript FIRST, you likely have zero damned business adding scripting to it!
I've lost count of the number of bounce inducing sites that blocks a great many users from even using their bloody contact from because some wanker spanked it all over the form with JavaScript. Asshattery like Angular, React, jQuery and so forth being directly responsible for this move away from building simple clean accessible designs.
Remember, screen readers and braille readers don't do JS well if at all... and the number of people using plugins like NoScript, Ghostery, ScriptSafe and so forth grows as there is a continued increase in DISGUST amongst users over the BS incompetent scripting people are basically just pissing all over their websites with.
NOTE I said WEBSITES!!! There's nothing wrong with react.js if you're making full stack crapplets using something like nw.js, electron, etc, since being inherently JS powered they are already a giant middle finger to accessibility and rarely if ever are bandwidth bound.
PHP will be the easiest platform to execute on a wide varieties of platforms, since most web servers (even the cheapest ones) come with it installed. No need for a VPS or SSH access - just upload and go (usually - unless you're using packages like composer or frameworks like Laravel or Symfony).
NodeJS on the other hand requires special hosting packages (like Heroku) or access to SSH. You won't be able to upload your files to most servers and expect things to work -- it'll require you to install dependencies onto the hosting server.
If I had to start my own website with little to no money, or if I planned on working with cheap clients, I'd use PHP.
If I wanted to (eventually) work for an enterprise-level operation that can pay for a bunch of cloud based microservices -- I'd go with NodeJS. You'll learn the most, as most of it's workflows (NPM, transpiling, etc) will translate to frameworks like React. It also forces you to go into the "backend" more than PHP ever will. Both will do server side rendering, but only NodeJS can create a virtual server (using Express).
Hope that cleared a little up. I struggled finding a clear answer between these technologies as everyone's opinions outweighed practical reasoning. Ideally NodeJS is better, but there's a reason PHP is so popular -- it's easier to implement.
Imho, PHP is the right way to go. It is fairly easy to install XAMPP or WPN-XM and just start writing what you are used to: HTML. Once you want to ad something server-side, you can add it as you progress, easily understanding why it makes sense to do so and instantly seeing the results!
Gabor
developer
I recommend to learn ASP.NET Core (C#) instead of them. There are a lot of learning resource on the official site plus a great ecosystem including VS Community IDE or VS Code. With the Core platform you can get more wide and serious knowledge what can be used later to get better offers from large companies as a freelancer or an employee.