PHP is advisable for making high-level web applications because It has a huge community. PHP has an experienced guidance because of the huge development era. That is why you can get any solution for your problem very easily.
It is a deep code based, means most of the Content Management Systems (like Joomla, WordPress, Magento, Drupal) are purely PHP based.
PHP is more common for hosting providers. This is because there is no compatibility issue to make application live on the server. The simplicity of the PHP code, it can run as HTML by changing extension of it.
No jar, preprocessor, no compiler and deployment dependency exists.
You can add php anywhere in your code by just using tag , that makes PHP more flexible.
Now, the trend is going in a way that most of the Startups are not using PHP as their Tech Stack because,
It is relatively slower than the advanced server-side development competitors like Node.
Since it is open sourced, so anyone can access it. If there are bugs in the source code, it can be used by people to explore the weakness of PHP.
It is not suitable for making larger applications; it is ideally suited for e-commerce based applications.
Most of the Startups are prioritizing Node over other monolithic stacks like PHP, or Ruby on Rails, because
Extraordinary faster than PHP because of the event callback mechanism.
Primarily, it has single-threaded mechanism, but you can also scale Node app on multi-core system. For more information about scaling, see my other article.
It has separation of concerns, i.e, separate modules for any operation.
Node.JS is popular, new and fresh.
It uses callback structure to pass logic from one call to another.
Less or relatively no chances of occurrence of deadlock mechanism.
It can use the single as well as multi-threaded application
Anyone with another platform background can jump to Node. It has numerous frameworks which can be used as an alternate for other frameworks like Ruby on Rails. Check out my article on top Node Frameworks.
Although, Node is providing the best possible solution, but there are always two sides of the mirror. Wisely think when making a Node application because
Node is not suitable for processor intensive tasks.
Any CPU-intensive code makes it really non-scalable.
Node or PHP, Can we use One over Another
Apart from all the stuff I have written, I noticed few of the startups that were proudly announced their platform as PHP, are now turning their architecture to Node.
The reason is not the speed/performance issue, but most of the startups are considering Node because it is new and popular and new means, according to the latest requirements and new features.
Shifting from PHP to Node is not as easy as it looks like, because PHP has lead of all the hosting servers.
A developer at Medium want to shift from PHP. He said that on top of all the popular alternatives to PHP there is a relatively new kid on the block called Node.js. Node never seemed like it would be a realistic competitor to the big languages when it came to writing complete server side code; it was just to new and unproven.
Note: There is a buzz that WordPress is switching from PHP to Node. However, let me clear, as per my research I did not get one reason for WordPress to shift their architecture to Node because all the plugins are full-fledged PHP based. They only changed their front end UI and wp-admin(dashboard) code to React.JS and calypso.
Both PHP and Node are the hottest languages of today. Use PHP for any e-commerce based application and Node for making highly scalable application, like chatting apps, or any apps that use rest services as a backend.