PHP Remi modules installed outside ansible trick
Remi modules are installed in non-standard location. Geerlingguy's ansible role harmonizes it and install it in standard locations.
So, if you're not familiar with standard locations, just do the following trick
NOTE: In this case, I installed the memcache module for php7.1 from Remi's repo.
1yum install -y php71-php-pecl-memcache.x86_64
Find where the memcache module is located
1[root@example-staging www]# find / -iname *memcache*.so
2/usr/lib64/httpd/modules/mod_socache_memcache.so
3/opt/remi/php71/root/usr/lib64/php/modules/memcache.so
Cross-check with a standard installed php module (you can see which modules via 'php -m')
1[root@example-staging www]# find / -iname sockets.so
2/usr/lib64/php/modules/sockets.so
3/usr/lib64/php-zts/modules/sockets.so
4/opt/remi/php71/root/usr/lib64/php/modules/sockets.so
So
1cd /etc/php.d
2ln -s /etc/opt/remi/php71/php.d/40-memcache.ini
"php -m" would show this error
1[root@example-staging php.d]# php -m|grep mem
2PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/memcache.so' - /usr/lib64/php/modules/memcache.so: cannot open shared object file: No such file or directory in Unknown on line 0
To fix, run:
1ln -s /opt/remi/php71/root/usr/lib64/php/modules/memcache.so /usr/lib64/php/modules/memcache.so
Rerun "php -m" and you will no longer have that error.