In our last post, we have talked about different web servers. We mentioned that each web server uses a different PHP handler. In this post, we’ll explain what is a PHP Handler and what are the types of it.
PHP is a scripting language that is used for most websites. As it’s obvious by its name, PHP handler is in charge of handling the PHP scripts of your website. When an audience asks for a PHP page, the server must parse the PHP code and create the outcome for the audience. Easy Apache gives you the ability to install PHP on your server and change it if you need.
There are 4 types of PHP handlers that each have different methods:
- Fast CGI
- SUPHP
- CGI
- DSO
As we said in the post about Linux web servers, you can choose any of these 4 as the PHP handler. We can’t say that which one it the best or better than the other three however they each have their own effects on Apache’s performance. So you need to choose your handler according to the effects you want it to have on Apache.
As an example, we are going to explain one of the PHP Handlers and its effects on Apache:
DSO
This handler is also known as Mod-PHP and is the fastest and the oldest one among these 4 handlers. DSO directly runs PHP codes by Apache so all your websites on the server must be visible by Apache to be work properly. Another good thing is that DSO uses little bit of CPU.
DSO works the best for the servers that need high speed and have limited number of websites on them.
DSO has two issues:
First is that the owner of the created PHP files the Nobody user which makes it unreadable on web.
The second thing is a security problem. Since the owner of all files is Nobody, if a hackers finds a way to access one of the PHP files,it may get the access to all of your server files.
Hope you enjoyed this post if you did you can visit our blog for more!