PHP versions, extensions, and cache


In your cPanel, you can change PHP version, go in section Softwares, icon 'Select PHP version'
(If you do not see icon 'Select PHP Version', this means that you are on a cPanel server without Cloudlinux, see explanation at the bottom of this article.)
Observe the current PHP versiondefault is version 7, as it is the most performant with opcache server based, stable, secure. This PHP selector from Cloudlinux apply one same PHP version to all domains of your cPanel account.

NB : If you use NGINX PHP-FPM : see our dedicated article, PHP 
selectors from Cloudlinux and cPanel do not work

How to switch PHP version ?
See dropdown menu just below, choose version, and click "Set as current", the version will apply to all domains of your account.
You can also personalize by choosing PHP extensions per PHP version, choose/remove what you need, save at bottom.

Hosting with multiple PHP versions

Here is the written list of the available php extensions :

apcu, bcmath, brotli, dba, dbase, dom, eio, enchant, fileinfo, gd, gender, geoip, geos, gmagick, gnupg, grpc, http, igbinary, imagick, imap, inotify, interbase, ioncube loader, json, ldap, luasandbox, lzf, mailparse, mbstring, memcache, memcached, mongodb, mysqli, mysqlnd, nd mysqli, nd pdo mysql, newrelic, oauth, oci8, odbc, opcache, pdf, pdo, pdo dblib pdo firefebird, pdo mysql, pdo oci, pdo odbc, pdo sqlite, pdo sqlsrv, pgsql, phalcon3, phar, posix, propro, pspell, raphf, redis, snmp, soap, sockets, sodium, sourceguardian, sqlsrv, ssh2, stats, swool, sysvmsg, sysvsem, sysvshm, tideways, tidy, timzonedb, trader, uploadprogress, uuid, vips, wddx, xdebug, xmlreader, xmlrpc, xmlwriter, xsl, yaf, yaml, zip, zmq

You can also put a different PHP version for 1 or more domains of your account by adding a piece of code in the .htaccess to the root of the relevant website folder :

Examples :

1. If you want to use a PHP version from branch 5, ie : PHP56, use 56, add this to the .htaccess file :

<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
SetHandler application/x-httpd-alt-php56___lsphp
For branch 7, PHP version 70 for example, use 70, you must use this syntax :
<FilesMatch "\.(php4|php5|php3|php2|php|phtml)$">
AddHandler application/x-httpd-alt-php70___lsphp .php .php5 .phtml
To customize your php.ini, you can only do this by clicking on the right top"Switch to PHP settings" : click on the value of the setting you wish to update and save. At each change of PHP version, you must set/verify again these values to same as previously. See our article for details :

NB : 
activating memcache in Prestashop require to add server
activating memcache in Wordpress require to add extension WP-FFPC or similar

For cPanel server without Cloudlinux (custom hosting and HA offers)
In your cPanel, section Softwares, you have :
- icon 'MultiPHP manager' for choosing php versions per domain basis
- icon 'MultiPHP ini editor' to customize your php.ini per domain basis
(There is no possibility at your level to choose extension php, you must open a ticket and ask what you need)