Advertisement
Guest User

ioncube

a guest
Oct 15th, 2015
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.87 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. # RoseHosting.com
  3.  
  4. # Check if PHP CLI is installed
  5. hash php 2>/dev/null || { echo >&2 "The script requires php5-cli but it's not installed.  Aborting."; exit 1; }
  6.  
  7. # Find the system architecture
  8. DPKG_ARCH=$(dpkg --print-architecture)
  9. if [[ "$DPKG_ARCH" = "i386" ]]; then
  10.   ARCH="x86"
  11. elif [[ "$DPKG_ARCH" = "amd64" ]]; then
  12.   ARCH="x86-64"
  13. fi
  14.  
  15. # Download and extract
  16. wget -q -O - "http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_${ARCH}.tar.gz" | tar -xzf - -C /usr/local
  17.  
  18. # Find PHP version
  19. PHP_V=$(php -v)
  20. PHP_VERSION=${PHP_V:4:3}
  21.  
  22. # Add the IonCube loader to the PHP configuration
  23. echo "zend_extension=/usr/local/ioncube/ioncube_loader_lin_${PHP_VERSION}.so" \
  24.     > '/etc/php5/conf.d/00-ioncube_loader.ini'
  25.  
  26. # Restart services
  27. for i in php5-fpm nginx apache2;do
  28.     test -x /etc/init.d/$i && /etc/init.d/$i restart
  29. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement