Bobcares

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.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF