Runcloud php custom module/ extension install

February 24, 2022 . 2 MIN READ

Installing custom PHP modules

Since we are rolling our own PHP Version, apt-get install php-* won’t work because it will replace our php and there will be a conflict. Thus, you need to compile your own modules to make it work. Don’t worry about it because most modules already shipped with RunCloud except you are trying to do some weird things inside your server.

This example will teach you how to compile pecl-sphinx inside your RunCloud Server.

You need to login as root user to be able to compile and install the module.

 

 

 

# Install the required developement tools
apt-get install autoconf libpcre3-dev
# Set module name
MODULE_NAME=”sphinx”
# Set download version
MODULE_VERSION=”1.3.3″
# Download & Extract
cd ~
wget https://pecl.php.net/get/$MODULE_NAME-$MODULE_VERSION.tgz
tar -zxvf $MODULE_NAME-$MODULE_VERSION.tgz
cd $MODULE_NAME-$MODULE_VERSION
# Installing for PHP5.5
# make clean will always fail if you never compile it before
make clean
/RunCloud/Packages/php55rc/bin/phpize –clean
/RunCloud/Packages/php55rc/bin/phpize
./configure –with-libdir=lib64 CFLAGS=’-O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fsigned-char -fno-strict-aliasing’
make install
echo “extension=$MODULE_NAME.so” > /etc/php55rc/conf.d/$MODULE_NAME.ini
systemctl restart php55rc-fpm
# Installing for PHP5.6
# make clean will always fail if you never compile it before
make clean
/RunCloud/Packages/php56rc/bin/phpize –clean
/RunCloud/Packages/php56rc/bin/phpize
./configure –with-libdir=lib64 CFLAGS=’-O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wall -pedantic -fsigned-char -fno-strict-aliasing’
make install
echo “extension=$MODULE_NAME.so” > /etc/php56rc/conf.d/$MODULE_NAME.ini
systemctl restart php56rc-fpm

Reference: https://runcloud.io/docs/guide/cheat-sheet/php

https://stackoverflow.com/questions/561024/install-pecl-ssh2-extension-for-php

https://runcloud.io/docs/guide/cheat-sheet/php

Leave a Reply

Your email address will not be published. Required fields are marked *