Skip to content

Instantly share code, notes, and snippets.

@asabirov
Created December 21, 2016 15:21
Show Gist options
  • Save asabirov/54338a1e37e7fd14db9c9845376c745e to your computer and use it in GitHub Desktop.
Save asabirov/54338a1e37e7fd14db9c9845376c745e to your computer and use it in GitHub Desktop.
cd /tmp
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar zxvf ioncube_loaders_lin_x86-64.tar.gz
PHP_CONFD=$(php --ini | grep "Scan for" | grep -oE "(\/.*)")
PHP_VERSION=$(php -r "echo PHP_MAJOR_VERSION.'.'.PHP_MINOR_VERSION;")
PHP_EXT_DIR=$(php-config --extension-dir)
cp "ioncube/ioncube_loader_lin_${PHP_VERSION}.so" $PHP_EXT_DIR
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/00-ioncube.ini"
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/../../fpm/conf.d/00-ioncube.ini" 2> /dev/null
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/../../cgi/conf.d/00-ioncube.ini"
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/../../apache2/conf.d/00-ioncube.ini"
echo "zend_extension = ${PHP_EXT_DIR}/ioncube_loader_lin_${PHP_VERSION}.so" > "${PHP_CONFD}/../../cli/conf.d/00-ioncube.ini"
rm -rf ./ioncube
rm ioncube_loaders_lin_x86-64.tar.gz
service php5-fpm restart
service php7-fpm restart
service apache2 restart
service httpd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment