ioncube.sh 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/sh
  2. #move to script directory so all relative paths work
  3. cd "$(dirname "$0")"
  4. #includes
  5. . ./config.sh
  6. . ./colors.sh
  7. . ./environment.sh
  8. #show cpu details
  9. echo "cpu architecture: $cpu_architecture"
  10. echo "cpu name: $cpu_name"
  11. #make sure unzip is install
  12. apt-get install -y unzip
  13. #remove the ioncube directory if it exists
  14. if [ -d "ioncube" ]; then
  15. rm -Rf ioncube;
  16. fi
  17. #get the ioncube load and unzip it
  18. if [ .$cpu_architecture = .'x86' ]; then
  19. #get the ioncube 64 bit loader
  20. wget --no-check-certificate https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.zip
  21. #uncompress the file
  22. unzip ioncube_loaders_lin_x86-64.zip
  23. #remove the zip file
  24. rm ioncube_loaders_lin_x86-64.zip
  25. elif [ .$cpu_architecture = ."arm" ]; then
  26. if [ .$cpu_name = .'armv7l' ]; then
  27. #get the ioncube 64 bit loader
  28. wget --no-check-certificate https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.zip
  29. #uncompress the file
  30. unzip ioncube_loaders_lin_armv7l.zip
  31. #remove the zip file
  32. rm ioncube_loaders_lin_armv7l.zip
  33. fi
  34. fi
  35. #set the version of php
  36. if [ ."$os_codename" = ."beowolf" ]; then
  37. php_version=7.3
  38. fi
  39. if [ ."$os_codename" = ."chimaera" ]; then
  40. php_version=7.4
  41. fi
  42. #copy the loader to the correct directory
  43. if [ ."$php_version" = ."7.3" ]; then
  44. #copy the php extension .so into the php lib directory
  45. cp ioncube/ioncube_loader_lin_7.3.so /usr/lib/php/20180731
  46. #add the 00-ioncube.ini file
  47. echo "zend_extension = /usr/lib/php/20180731/ioncube_loader_lin_7.3.so" > /etc/php/7.3/fpm/conf.d/00-ioncube.ini
  48. echo "zend_extension = /usr/lib/php/20180731/ioncube_loader_lin_7.3.so" > /etc/php/7.3/cli/conf.d/00-ioncube.ini
  49. #restart the service
  50. /usr/sbin/service php7.3-fpm restart
  51. fi
  52. if [ ."$php_version" = ."7.4" ]; then
  53. #copy the php extension .so into the php lib directory
  54. cp ioncube/ioncube_loader_lin_7.4.so /usr/lib/php/20190902
  55. #add the 00-ioncube.ini file
  56. echo "zend_extension = /usr/lib/php/20190902/ioncube_loader_lin_7.4.so" > /etc/php/7.4/fpm/conf.d/00-ioncube.ini
  57. echo "zend_extension = /usr/lib/php/20190902/ioncube_loader_lin_7.4.so" > /etc/php/7.4/cli/conf.d/00-ioncube.ini
  58. #restart the service
  59. /usr/sbin/service php7.4-fpm restart
  60. fi