-
-
Save Schrank/f7251cb166f832e4fc96 to your computer and use it in GitHub Desktop.
# Put this file into puphpet/files/exec-once/install-ioncube so it only executed once | |
# it loads ioncube, unzips it, move and add it to php.ini | |
echo "Loading ioncube" | |
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz | |
echo "Unzipping ioncube" | |
tar xvfz ioncube_loaders_lin_x86-64.tar.gz | |
echo "Move ioncube to usr/local" | |
mv ioncube /usr/local | |
echo "Add ioncube to php.ini" | |
sudo sed -i 1i"zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.5.so" /etc/php5/cli/php.ini | |
echo "Restarting apache" | |
sudo service apache2 restart |
I believe you just need to add:
sudo sed -i 1i"zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.5.so" /etc/php5/fpm/php.ini
This is what worked for me:
echo "Loading ioncube"
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
echo "Unzipping ioncube"
tar xvfz ioncube_loaders_lin_x86-64.tar.gz
echo "Move ioncube to usr/local"
mv ioncube /usr/local
echo "Add ioncube to php.ini"
sudo sed -i 1i"zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.4.so" /etc/php5/fpm/conf.d/zzzz_custom.ini
sudo sed -i 1i"zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.4.so" /etc/php5/cli/conf.d/zzzz_custom.ini
echo "Restarting Apache and FPM"
sudo service apache2 restart
sudo service php5-fpm restart
Nice, thanks Brian.
I was running a CentOS instance w/ php-fpm so my config had to be modified a bit. My php complained about my zend_extension declaration being in zzzz_custom.ini (which was located in /etc/php.d/zzzz_custom.ini)
NOTICE: PHP message: PHP Fatal error: [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0
Here's the finished script:
echo "Loading ioncube"
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
echo "Unzipping ioncube"
tar xvfz ioncube_loaders_lin_x86-64.tar.gz
echo "Move ioncube to usr/local"
mv ioncube /usr/local
echo "Add ioncube to php.ini"
sudo sed -i 1i"zend_extension=/usr/local/ioncube/ioncube_loader_lin_5.5.so" /etc/php.ini
echo "Restarting apache/php-fpm"
sudo service httpd restart
sudo service php-fpm restart
only works for PHP 5.5 in CLI as far as I can see