How to install PHP extensions like GD when domain has different PHP version

4 posts / 0 new
Last post
#1 Fri, 05/26/2017 - 03:51
Ben Scheffer

How to install PHP extensions like GD when domain has different PHP version

Setup: Centos 7.3.1611, Webmin 1.840, Virtualmin 5.07

I successfully installed multiple php versions as described in https://www.virtualmin.com/documentation/web/multiplephp. I'm trying to install Owncloud in one of my virtual domains, with PHP 7 as php version. Owncloud requires modules (like GD) that are not available in (my install of) php 7. When I install these on the command line, they seem to become available for php 5.4.16 but not for php 7. So I tried this:

  1. copy gd.so from usr/lib64/php/modules to /opt/rh/rh-php70/root/usr/lib64/php/modules
  2. added extension=gd.so to the loaded php.ini, which is in the virtual domain at etc/php7.0
  3. restarted apache

But that didn't work, so I'm hoping someone at the forum knows the correct procedure, or can point me to a previously given answer. Btw. It's not just gd. All of the installed php modules are only listed with the first php, not the chosen one.

Sat, 05/27/2017 - 06:14
Ben Scheffer

Found it myself: in my setup extra php7 modules can be installed from SCL (https://wiki.centos.org/AdditionalResources/Repositories/SCL). In that repository module names are prefixed with rh. So GD can be installed using: yum install rh-php70-php-gd

Sun, 07/23/2017 - 18:31
crewmark

Thanks for putting this in Ben... helped a long search :)

Wed, 07/04/2018 - 10:22
ktc

Winner Winner Chicken Dinner. Exactly what I needed. THX

// Kaitlyn Considine - SITEWORKS Hosting Network LLC

Topic locked