How to use Multi-PHP Manager on the command line – Part 1

We have already discussed how to use MultiPHP Manager in Web Host Manager. You can use MultiPHP manager in whm  easily to use multi-php feature that easyapache 4 offers however if you love to work on command line instead of graphical interface this guide is only for you.  In this post, we will discuss how to use use Multi-PHP Manager on the command line.

Part 1 :  How to change default php version
Part 2 :  How to change php handlers

Easyapache 4 offers ability to set php version per domain basis using Multi-PHP Manager however we still need to set global default php version which will be used by the domain with no custom php version. For this purpose, we will use script that cPanel offers which is /usr/local/cpanel/bin/rebuild_phpconf
Let’s discuss various argument this script accept to change php version.

  • Display the current default PHP version. Following output shows PHP 5.6 being the default php version for this server.
[root@server ~]# /usr/local/cpanel/bin/rebuild_phpconf --current
 DEFAULT PHP: ea-php56
 ea-php54 SAPI: cgi
 ea-php55 SAPI: cgi
 ea-php56 SAPI: cgi
 ea-php70 SAPI: cgi
 ea-php71 SAPI: cgi
 [root@server ~]#
  • Now, let’s say we want to setup php 7 as our default php version for this server.
[root@server ~]# /usr/local/cpanel/bin/rebuild_phpconf --default=ea-php70
[root@server ~]#

Above command did not display any output. We can view changes by providing –curent argument with /usr/local/cpanel/bin/rebuild_phpconf command. Let’s see.

[root@server ~]# /usr/local/cpanel/bin/rebuild_phpconf --current
DEFAULT PHP: ea-php70
ea-php55 SAPI: suphp
ea-php56 SAPI: suphp
ea-php70 SAPI: suphp
ea-php71 SAPI: suphp
[root@server~]#

It shows our current default php version is php 7. In next article we will discuss how to manage php handlers from command line.

Leave a Reply

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

CommentLuv badge