Use A Custom PHP Version in WHM / Cpanel (Litespeed)

In WHM / Cpanel many hosts like us use Litespeed to speed up PHP and the server. Litespeed allows multiple versions of PHP that you can configure using .htaccess php handlers. But what about changing the PHP version used for command line (also for cron jobs)? There is a easy solution. Login to ssh for the cpanel account, and in the home/username/.bashrc file (you can edit with with: nano .bashrc) add this line to the end (substitute the /usr/bin/php5.6 with the path to the custom php binary you want to use):

alias php='/usr/bin/php5.6'

Now logoff and login to ssh, and if you type:

php -v

you can confirm it’s using the version of PHP you want.

We will be closed January 4 - March 11, 2024. You can still order but for any installs or support tickets please expect a delayed response

Out of Office

FREE RENTAL CONTRACT PDF / WORD FILE

Please signup with your email and we'll send you the files 

We'll send you a few follow up emails with great Rental Business Tips, Special Offers, ways to increase sales, and more.

No thanks, I'll pass
15585

Get The Latest Rental Business Tips and Updates!

Special Offers, Product Updates, Insider Business Tips, sign up today to the Sales Igniter Email List!