Bobcares

For every $500 you spend, we will provide you with a $500 credit on your account*

BLACK FRIDAY SPECIAL

*The maximum is $4000 in credits, Offer valid till November 30th, 2024, New Customers Only, Credit will be applied after purchase and expires after six (6) months

For every $500 you spend, we will provide you with a $500 credit on your account*

BLACK FRIDAY SPECIAL

*The maximum is $4000 in credits, Offer valid till November 30th, 2024, New Customers Only, Credit will be applied after purchase and expires after six (6) months

PHP Handlers for your Server – Choose the appropriate one

by | Mar 24, 2021

Confused between various PHP Handlers? We can help you.

We can configure PHP in the server using different files and implementations. It is the PHP Handler that determines how PHP implement and work on the server.

As part of our Server Management Services, we assist our customers with several PHP queries.

Today, let us focus on the various PHP handlers and their pros and cons.

 

Why are PHP Handlers important?

A major reason for PHP being the base of a large percentage of websites is because website applications like WordPress and Joomla run on PHP.

If we have a server hosting a large number of PHP-based websites, it’s better to monitor the server, its resource usage, traffic, etc, and select the most efficient handler.

The security level varies for different handlers. However, they play a major role in the server’s stability, speed, and security.

Available PHP handlers are DSO, CGI, SuPHP, and FastCGI. Each handler differs in its implementation and performance.

  • Dynamic Shared Object (DSO)

Also known as mod_php, it is the default and the oldest handler. It runs PHP as an Apache module.

Pros:

  1. DSO is the fastest handler.
  2. CPU usage is low.

Cons:

  1. Security issue: While using DSO, PHP scripts will run as user nobody. Hence, if a hacker finds a vulnerability, he can modify important files. The best way to prevent such vulnerabilities is to keep the applications up to date.
  2. File Permissions: If the website provides an option to create files using PHP scripts, we will run into permission issues. The files created will be owned by nobody which will trigger permission errors.
  • Single User PHP (SuPHP)

SuPHP runs PHP as a CGI module. cPanel recommends this handler. The PHP scripts will run as the user who calls it.

Pros:

  1. Security: Since PHP scripts run as the user who called it, the hacker won’t get access to files outside the user’s home directory.
  2. Permissions: The files created will be under the ownership of the corresponding user. So we won’t run into permission issues.

Cons:

  1. High CPU usage: The CPU usage of this handler high.
  2. Low speed compared to DSO.
  • Common Gateway Interface (CGI)

It is the least used handler. It runs PHP as a CGI module. PHP scripts will run as user nobody unless suEXEC is enabled. It is not so fast or secure.

  • FastCGI

It is an implementation of CGI and it runs PHP as a CGI module. It overcomes most of the disadvantages of CGI.

Pros:

  1. High Speed comparable to DSO.
  2. As with SuPHP, PHP scripts will run as the user, a hacker won’t be able to infect files outside the user’s home directory.

Cons :

  1. High memory usage: This handler has the highest memory usage. Our Support Techs don’t recommend it for servers running low on memory.

In addition, most of the control panels provide the option to switch the handler from the front end interface itself.

[Found the article helpful? Here’s more like it]

 

Conclusion

In short, selecting the proper PHP handler plays a major role in the server’s stability and performance. Today, we saw pros and cons of different PHP Handlers.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.