What is PHP?
Processing behind the scenes allows a website to interact with the user if only to enter login credentials. PHP is the most common programming language to carry out the processing. It is especially important where the website interacts with a database, for example, when displaying a product or price list in an e-commerce application.
Because PHP has links with other components providing information, it needs to keep its interfaces up to date. A good example is a common requirement to link with MySQL databases.
As a result, updating another website component often means PHP also needs to be upgraded. Be aware that some earlier PHP versions are reaching end-of-life and won’t be supported in the future. The minimum recommended PHP level is 5.6, and the current is Version 8.
Be aware though, that you may need to have several versions of PHP installed at the same time to support different website applications. That will certainly be the case in a VPS Hosting scenario.
An essential thing to do before updating PHP is to check for any dependencies between web components. Stack Overflow gives some help on how to check compatibility between versions.
If you are running a WordPress site, there are three more things to do:
- Bring all plugins, themes and WordPress itself up to date. Do this from the WordPress dashboard.
- To check your plugins and themes for any possible issues, download, install and run the PHP Compatibility Checker plugin from the WordPress website. Beware, this plugin isn’t 100% effective. It doesn’t find every issue and could report false positives. However, it will work for most standard implementations. Fix any issues found by the compatibility checker.
- A further check is by using the WordPress requirements codex article which will tell you the minimum PHP version you should be using.
What is cPanel?
cPanel is a graphic, windows-like control dashboard that helps users with no or little technical knowledge manage a web-hosting server. Most Managed Service providers use it, making it one of the most popular control panels.
It usually has the WHM (Web Host Manager) component. WHM provides admin control over a server.
cPanel provides some additional benefits including management statistics, some SEO features and support for MySQL databases.
There is more information here.
What is WHM?
In short, Web Host Manager, or WHM, is a powerful application that allows users to have administrative access to the back end of cPanel. Obviously, you need cPanel before installing WHM. In effect, it extends cPanel to provide a control dashboard that gives the user the ability to manage several cPanel-Based sites from a single screen. Ideal for a VPS hosting environment.
Two key reasons for using WHM are:
Better site security.
- Different panels for each site means that if one VPS server domain is hacked through cPanel, others won’t be affected. This makes the VPS implementation more secure.
- WHM gives you the ability to monitor all the websites in your VPS hosting environment from one application, flicking between each cPanel easily. You can also adjust the bandwidth and disk space available to each.
Why do you need a PHP selector?
In a Managed Server Provider or multi-server environment, it is inevitable that each user will need different PHP versions to run their applications. Ideally, the MSP should give their customers the ability to select the version(s) and PHP extensions they need.
With CloudLinux, you can make use of a feature providing that facility: PHP Selector. The alternative is to use EasyApache4 and the cPanel offering: MultiPHP Manager.
However, PHP Selector has an important advantage over MultiPHP Manager: it allows a single cPanel user to manage their PHP environment without contacting their MSP.
How to install PHP Selector in WHM?
Giving an answer to “How to install PHP Selector in WHM?” depends entirely on the environment in which it is to be installed.
- Before integrating PHP Selector with cPanel under CloudLinux, there are some prerequisites. Basically, make sure that you have the following components installed:
- This is the CloudLinux manager application and is installed by default when you install CloudLinux.
- CageFSsupports a user-based, virtual file system specific to each user account. It is designed to prevent users from seeing each other’s systems and data. In addition, it assists with malware protection.
- There is an issue that cPanel and WHM do not show the versions of PHP available to be used. PHP must therefore be reinstalled by typing “yum install alt-PHP*” in cPanel.
The installation process thereafter is too technical for this document.
EasyApache4 and MultiPHP
- As mentioned above an alternative, less-performant, but still an alternative is EasyApache 4 and MultiPHP.
What does EasyApache 4 offer?
Users can use EasyApache 4 to install, configure, update, and validate their web server, PHP, and other components of a web server.
cPanel & WHM don’t have EasyApache 4 as a prerequisite. The cPanel & WHM license includes the EasyApache 4 software.
EasyApache 4 supports multiple versions of PHP.
MultiPHP enables the user to have different PHP versions assigned to each domain. It also provides an automatic upgrade feature that ensures that PHP applications always use the most up-to-date PHP version.
In a web hosting environment, particularly one provided by a hosting provider, support for multiple versions of PHP is going to be needed. Managing that environment is technically quite complex unless you use software like CloudLinux, WHM and cPanel to manage it.
If you are still confused, or if you still want a chat about PHP and what you would need in a hosted environment, please don’t hesitate to contact our friendly and knowledgeable staff.