I’m a PHP Developer by profession and I’ve never used Node.js in my life.
The above statement created one query in my mind that like Node.js is there any runtime environment exist for the server-side programming language PHP?
Someone please clear my doubt in case of runtime environment for PHP. If it’s present where it is and what it comprises of? If not, then explain how does PHP allow to build server-side applications without having a runtime environment?
Following is my current setup for PHP :
I’m using PHP 7.4.2 on my laptop that runs on Windows 10 Home Single Language 64-bit operating system.
I’ve installed the latest version of XAMPP installer on my laptop which has installed the Apache/2.4.41 (Win64) and PHP 7.4.2
I’m not sure to understand yours questions, but i’ll try to answer you properly.
As en interpreted language I think PHP could not be considered to have runtime environment.
I’ll assume by runtime environment you may reference to a complete environment isolated from the other part of the system( like Java VM)
You can use generally PHP in two main ways:
– with a web server (websites, web apps..)
– a standalone executable (CLI scripts)
With a web server, you can not assume this a runtime environment as it come separately: webserver + php module for this webserver
As a standalone executable, you may have environment variables and others configurable environment elements related but this not isolated from the rest of the operating system:
- It doesn’t execute is own bytecode (however you could use OPCache
- It doesn’t manage it own threads : same as above you can use extension
It’s complety différent from NodeJS which use a VM(V8) from my point of view.