Node.js and PHP both are the powerful back-ends to create versatile websites.

Even when these two technologies fall under the same category, their features are pretty diverse. There’s no doubt – PHP is one of the popular and commonly used languages for server-side scripting, whereas Node.js, introduced in 2009, made it feasible to work with JavaScript programming on the server-side scripting. Thus, the rise of websites is entirely powered by JavaScript stacks for the back-end and the front-end. But before getting to any conclusion or comparing them, let’s discuss both of these technologies, Node.js and PHP, in brief.
Node.js is a non-proprietary and platform-independent runtime environment for implementing JavaScript code outside of a browser. Node.js was developed in 2009 by Ryan Dahl and was designed using JavaScriptC++, and C. It was built on the JavaScript V8 Engine, used in Google Chrome. However, Node.js is not a framework and not a programming language. We frequently use Node.js for creating back-end administrations like APIs for Web or Mobile Applications. It is being used by enormous organizations, for example, Uber, Paypal, Walmart, Netflix, and many more.
PHP is a non-proprietary and platform-independent scripting language particularly suitable for web development. PHP was designed in 1994 by a Danish-Canadian programmer named Rasmus Lerdorf, and developed by the PHP Development Team at Zend Technologies. It has been the first choice for many tech industries for more than two decades. PHP was an acronym for Personal Home Page originally; however, it now stands for the recursive acronym, i.e., Hypertext Preprocessor. According to the statistics produced by w3Techs, around 79% of websites use PHP as their server-side programming language and a preference for content management systems like Joomla, Drupal, Shopify, WordPress, and many more.
There are some similarities between these two technologies, as follows:
Pros:
Cons:
Pros:
Cons:
Both the programming languages, Node.js and PHP, are popular due to their features, usability, and tools. We can see various famous websites that have been built on the top of these tech giants.  Some of these popular websites are listed below:
Both of these programming languages, Node.js and PHP, have their own pros and cons. And we need to leverage our skills in both environments to pick the right platform to work on.
PHP can be a great choice for web portals, blogs, landing pages, and news sites. We can easily build e-commerce sites and blogs without much coding. In addition to it, PHP also provides many customized themes that give new opportunities to web developers. PHP stands out to be a better choice if hosting support is an issue.
On the other hand, Node.js comes out to be a great fit if someone plans to build real-time applications such as IM, video conferencing, and many more. Node.js is perfect for server-side events that make it easy to execute, subscribe, and publish architectures in real-time applications. This Node.js feature allows the developers to build IoT applications with flexible and heavy client-side functionality.
While choosing between Node.js and PHP, we must consider what type of application we are going to develop. We should keep it in mind; if we are looking to develop real-time applications, we should choose Node.js. On the contrary, we should consider PHP if we are looking for a standardized solution with fantastic hosting support.

source