How to Install PHP Selector using CloudLinux OS?

PHP Selector is one of the coolest features of CloudLinux. It allows you to choose PHP versions for each website on your cPanel server. Today we are going to show you how to install php selector on cPanel servers.

PHP Selector also allow users to customize their PHP settings with just a few clicks. In old times, users needed to edit or upload an .htaccess or php.ini file to their public_html workspace, but that’s no longer needed. With CloudLInux’s PHP Selector you only need to click the modules you need, hit Save button and that’s all.

Let’s start the installation tutorial.

PHP Selector Requirements

cPanel Accounts need to have CageFS enabled in order to work with PHP Selector.

PHP Selector is only compatible with this web server technologies: suPHP, mod_fcgid, CGI (suexec), LiteSpeed.

Important: If you are running php-fpm, mod_php/DSO (that also includes mod_ruid2 and MPM ITK), then you will not be able to run PHP Selector, as it is not compatible with those technologies. In that case, we encourage you to migrate to suPHP, check out this post: How to migrate from DSO to suPHP on cPanel/WHM servers

We will assume you already have CloudLinux OS with CageFS and LVE installed and fully working on your web hosting enviroment.

How can I install PHP Selector on cPanel?

The command to install php selector is just a simple yum order:

yum groupinstall alt-php

After that, updadate your LVE and CageFS installations to pickup the PHP Selector instalation:

yum update cagefs lvemanager

Now move to WHM – Feature Manager, make sure ‘Select PHP version’ is enabled on your feature lists.

Default Configuration Paths for Alt-PHP Package

  • php.ini path: /opt/alt/php52/etc
  • loaded config file: /opt/alt/php52/etc/php.ini
  • additional .ini files /opt/alt/php52/etc/php.d

Those are the general paths for the new alt-php linux package.

How can I edit PHP settings for a particular user/domain?

PHP Selector not only allow your cPanel users to select their own particular PHP version for each site, but also allow users and developers to customize their PHP settings like memory_limit, max_execution_time, max_upload_filesize and much more from the web interface of PHP Selector after choosing your customized version of PHP.

Check out this screenshots that show the process in a graphical way:

install PHP Selector
cPanel – PHP Selector
cPanel - PHP Selector - extensions - choose your PHP version
cPanel – PHP Selector – extensions – choose your PHP version
cPanel - PHP Selector - extensions
cPanel – PHP Selector – extensions

Further reading: 

About the Author: Santiago Borges

Experienced Sr. Linux SysAdmin and Web Technologist, passionate about building tools, automating processes, fixing server issues, troubleshooting, securing and optimizing high traffic websites.

Leave a Reply

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