Cài memphp với ssh – xóa php-*, cài mbstring

Muốn cài các gói php thì cần phải loại bỏ php-* khỏi yum.conf
sử dụng lệnh: nano /etc/yum.conf
exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* nsd* p0f proftpd* pure-ftpd* sp$
Sau khi xóa php-* tại exclude bấm ctr+O để lưu, nhấn  Ctr+x để thoát hoặc nếu có hỏi Y/N .. thì sau khi bấm Y hoặc N rồi ENTER sẽ lưu và thoát

Please check your /etc/yum.conf file, maybe it is exclude php packages.

You should remove php* from this line so you can download php-* packages:

exclude= courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* php*

It’s seems your server having some scripts like cPanel

 

 

Cách cài mbstring

Kết hợp sử dụng WHM và ssh ZOC7 để cài và kích hoạt mbstring.

Bước 1: kích hoạt cài mbstring trên WHM trước,

Click EasyApache4 => Click tab php extension search key mbstring và kích hoạt

Bước 2: chạy lệnh ssh như bên dưới là hoàn tất

[root@server ~]# yum install ea-php56-php-mbstring

 

How to enable new Apache or PHP module in cPanel EasyApache 4

 

The main disadvantage of EasyApache 3 was that it took almost 20 – 30 minutes just to add a new PHP or Apache module. This is because every change you need to make requires a full recompile of Apache and PHP. This is fixed in EA4 through Yum and RPM’s and now it takes just seconds to install a new module. So, in this article, we will discuss on how to enable new Apache or PHP module in cPanel EasyApache 4.

Enable new Apache or PHP module in cPanel EasyApache 4

As I informed earlier a major change in EasyApache 4 is the move of the EA4 interface into the system package manager. Hence, you can easily install a missing module from “EasyApache 4” interface in WHM or directly from commandline.

Steps to enable new Apache or PHP module in cPanel EasyApache 4 from WHM

  1. Login to WHM panel of your server and move to Home >> Software >> EasyApache 4.
  2. Begin customizations by clicking the “Customize” button on the default profile.  easyapache_4
  3. On the new page, you can find the different categories like Apache MPM,  Apache Modules, PHP and PHP Extensions on the left side panel. Check the below screenshot for details.edit_profile
  4. Select the appropriate category and enable the modules by just clicking the button provided on the right-hand side. Refer the screenshot’s given below for more details.enable_apache_module
  5. Here, the already enabled modules or extensions will be shown as “Unaffetced”. Refer the below image for details.unaffected
  6. Once you have enabled all the required modules, go to “Review” section. It will list all the changes that you are going to make by provisioning the current profile. The following screenshot will give you more idea about this.easyapache_review
  7. Finally, you can provision the profile by clicking the “provision” button on the bottom of the “Review” page. easyapache_provision
  8. That’s it!!

Steps to enable new Apache or PHP module in cPanel EasyApache 4 from Commandline.

  1.  Login to the server as root.
  2. Use the “yum install” command to install your desired Apache or PHP module.

Install an Apache module:

Firstly, check whether the package is already installed on the server using rpm command.

[root@server ~]# rpm -qa | grep package_name
[root@server ~]#

If it’s not previously installed, you can install the package on the command line with the following command:

yum install package_name

Eg:

To install Apache mod_remoteip module, just execute the following command.

[root@server ~]# yum install ea-apache24-mod_remoteip

Install a PHP module:

EasyApache 4’s packages for PHP modules and extensions use the ea-php##-php-module naming convention, where ## represents the PHP version number and module represents the name of the PHP module.

Please check whether the module is already installed by using either the rpm command or directly via command “php -m | grep php_module”.

Eg:

[root@server ~]# yum install ea-php56-php-mbstring

The above example installs the ea-php56-php-mbstring package, where  56 represents the PHP version and mbstring represents the extension name.

That’s it. You are done!!!

Leave a comment for any queries.