Skip to content
Advertisement

What is the difference between PHP and libapache2_mod_php

I’m new to system administration and while launching oho files with Apache 2 server I had to install php on my Ubuntu 16.04.

I tried the basic sudo apt-get install php, which only loaded a blank page (php file).

But installing libapache2_mod_php solved my problem.

I want to understand the differences .

Advertisement

Answer

It’s pretty simple: Apache is WWW Server, PHP – a interpretter. By libapache2_mod_php library, the Apache can send request to the PHP, which builts website, sends rendered HTML (or whatever else) to the Apache, and it is later responsed to the user.

The flow is something like that: enter image description here

without that library, the Apache don’t know what is .php file, and recognizes it like raw file which can be downloaded, without being interpreted by PHP (sometimes it’s very dangerous, for example when you are storing passwords in PHP file).

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement