For reference, I also have some cool oneliners to help automate that process if installing for multiple LSPHP versions for admins and power users who may come across this and is using multiple versions and want to automate the task.
Something like this would work nicely as a oneliner to batch install a pecl module for all versions.
Can adjust the lsphp to have this just installed for LSPHP 7.x versions “lsphp7*-devel”
yum install -y re2c lsphp7*-devel make gcc glibc-devel zlib-devel;
or just have it go for all versions removing the 7
yum install -y re2c lsphp*-devel make gcc glibc-devel zlib-devel;
This command would work to install the module for all detected LSPHP versions specified and also do you the courtesy of adding it to the end of all listed modules via “zzzzzzz-pecl.ini” so that step is not forgotten and you dont have to check and guess which order each version is in.
Extension=“mailparse”;for version in $(ls /usr/local/lsws|grep lsphp); do /usr/local/lsws/${version}/bin/pecl install ${Extension} && echo “extension=${Extension}.so” >> /usr/local/lsws/${version}/etc/php.d/zzzzzzz-pecl.ini; done
Then granted no errors during install you could restart the services.
systemctl restart lsws||service lsws restart;
You can then check for it via this command
Extension=“mailparse”;for phpver in $(ls -1 /usr/local/lsws/ |grep lsphp | sed ‘s/lsphp//g’) ; do echo “”; echo “LSPHP $phpver” ; /usr/local/lsws/lsphp$phpver/bin/php -m | grep -E “${Extension}”; done
Putting that all together it would look like this.
yum install -y re2c lsphp7*-devel make gcc glibc-devel zlib-devel; Extension=“mailparse”;for version in $(ls /usr/local/lsws|grep lsphp); do /usr/local/lsws/${version}/bin/pecl install ${Extension} && echo “extension=${Extension}.so” >> /usr/local/lsws/${version}/etc/php.d/zzzzzzz-pecl.ini; done; systemctl restart lsws||service lsws restart; systemctl status lsws||service lsws status;
Obviously, if you are not sure what your doing the above is probably not something I would recommend. Doing stuff one at a time may be in your best interests in that case.