For any devs out there looking to bulk install extensions or scripting, you may find this helpful and save you some time.
Pecl update all Versions
for version in $(ls /usr/local/lsws|grep lsphp); do /usr/local/lsws/${version}/bin/pecl channel-update pecl.php.net; done
Imagemagick
for version in $(ls /usr/local/lsws|grep lsphp); do printf ’
’ | /usr/local/lsws/${version}/bin/pecl install imagick && echo “extension=imagick.so” > /usr/local/lsws/${version}/etc/php.d/zzzzzzz-pecl.ini; done
Variable one template that has a prompt
for version in $(ls /usr/local/lsws|grep lsphp); do printf ’
’ | /usr/local/lsws/${version}/bin/pecl install $Extension && echo “extension=$Extension” > /usr/local/lsws/${version}/etc/php.d/zzzzzzz-pecl.ini;done
Variable one template that dones not an installation prompt
for version in $(ls /usr/local/lsws|grep lsphp); do /usr/local/lsws/${version}/bin/pecl install $Extension && echo “extension=$Extension” > /usr/local/lsws/${version}/etc/php.d/zzzzzzz-pecl.ini; done
Checking all installed php versions for modules. replace with your desired modules in the grep regex at the end
for phpver in $(ls -1 /usr/local/lsws/ |grep lsphp | sed ‘s/lsphp//g’) ; do echo “PHP $phpver” ; /usr/local/lsws/lsphp$phpver/bin/php -m |grep -E ‘memcached|imagick|ionCube Loader’; done
Example:
for version in $(ls /usr/local/lsws|grep lsphp); do /usr/local/lsws/${version}/bin/pecl channel-update pecl.php.net; done
Updating channel “pecl.php.net”
Channel “pecl.php.net” is up to date
Updating channel “pecl.php.net”
Channel “pecl.php.net” is up to date
Updating channel “pecl.php.net”
Channel “pecl.php.net” is up to date
Updating channel “pecl.php.net”
Channel “pecl.php.net” is up to date
Updating channel “pecl.php.net”
Channel “pecl.php.net” is up to date
Updating channel “pecl.php.net”
Channel “pecl.php.net” is up to date
Updating channel “pecl.php.net”
Channel “pecl.php.net” is up to date
Updating channel “pecl.php.net”
Channel “pecl.php.net” is up to date
Checking all versions for memcached,imagick,ionCube Loader extensions
for phpver in $(ls -1 /usr/local/lsws/ |grep lsphp | sed ‘s/lsphp//g’) ; do echo “PHP $phpver” ; /usr/local/lsws/lsphp$phpver/bin/php -m |grep -E ‘memcached|imagick|ionCube Loader’; done
PHP 70
imagick
memcached
PHP 71
imagick
ionCube Loader
memcached
PHP 72
imagick
ionCube Loader
memcached
PHP 73
imagick
ionCube Loader
memcached
Enjoy