Create ioncube.sh

This commit is contained in:
FusionPBX 2018-02-28 01:20:33 -07:00 committed by GitHub
parent 9e72bd2949
commit 58892a8f7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 37 additions and 0 deletions

37
debian/resources/ioncube.sh vendored Normal file
View File

@ -0,0 +1,37 @@
#!/bin/sh
#move to script directory so all relative paths work
cd "$(dirname "$0")"
#includes
. ./config.sh
. ./colors.sh
. ./environment.sh
#make sure unzip is install
apt-get install unzip
#get the ioncube 64 bit loader
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.zip
#uncompress the file
unzip ioncube_loaders_lin_x86-64.zip
#remove the zip file
rm ioncube_loaders_lin_x86-64.zip
#copy the loader to the correct directory
if [ ."$php_version" = ."5" ]; then
#copy the php extension .so into the php lib directory
cp ioncube/ioncube_loader_lin_5.6.so /usr/lib/php/20151012
fi
if [ ."$php_version" = ."7" ]; then
#copy the php extension .so into the php lib directory
cp ioncube/ioncube_loader_lin_7.0.so /usr/lib/php/20151012
#add the 00-ioncube.ini file
echo "zend_extension = /usr/lib/php/20151012/ioncube_loader_lin_7.0.so" > /etc/php/7.0/fpm/conf.d/00-ioncube.ini
#restart php fpm
service php7.0-fpm restart
fi