ioncube.sh 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. #make sure unzip is install
  9. apt-get install -y unzip
  10. #remove the ioncube directory if it exists
  11. if [ -d "ioncube" ]; then
  12. rm -Rf ioncube;
  13. fi
  14. #get the ioncube load and unzip it
  15. if [ .$cpu_architecture = .'x86' ]; then
  16. #get the ioncube 64 bit loader
  17. wget --no-check-certificate https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.zip
  18. #uncompress the file
  19. unzip ioncube_loaders_lin_x86-64.zip
  20. #remove the zip file
  21. rm ioncube_loaders_lin_x86-64.zip
  22. elif [ ."$cpu_architecture" = ."arm" ]; then
  23. if [ .$cpu_name = .'armv7l' ]; then
  24. #get the ioncube 64 bit loader
  25. wget --no-check-certificate https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_armv7l.zip
  26. #uncompress the file
  27. unzip ioncube_loaders_lin_armv7l.zip
  28. #remove the zip file
  29. rm ioncube_loaders_lin_armv7l.zip
  30. fi
  31. fi
  32. #copy the loader to the correct directory
  33. if [ ."$php_version" = ."5.6" ]; then
  34. #copy the php extension .so into the php lib directory
  35. cp ioncube/ioncube_loader_lin_5.6.so /usr/lib/php5/20131226
  36. #add the 00-ioncube.ini file
  37. echo "zend_extension = /usr/lib/php5/20131226/ioncube_loader_lin_5.6.so" > /etc/php5/fpm/conf.d/00-ioncube.ini
  38. #restart the service
  39. service php5-fpm restart
  40. fi
  41. if [ ."$php_version" = ."7.0" ]; then
  42. #copy the php extension .so into the php lib directory
  43. cp ioncube/ioncube_loader_lin_7.0.so /usr/lib/php/20151012
  44. #add the 00-ioncube.ini file
  45. echo "zend_extension = /usr/lib/php/20151012/ioncube_loader_lin_7.0.so" > /etc/php/7.0/fpm/conf.d/00-ioncube.ini
  46. #restart the service
  47. service php7.0-fpm restart
  48. fi
  49. if [ ."$php_version" = ."7.1" ]; then
  50. #copy the php extension .so into the php lib directory
  51. cp ioncube/ioncube_loader_lin_7.1.so /usr/lib/php/20160303
  52. #add the 00-ioncube.ini file
  53. echo "zend_extension = /usr/lib/php/20160303/ioncube_loader_lin_7.1.so" > /etc/php/7.1/fpm/conf.d/00-ioncube.ini
  54. #restart the service
  55. service php7.1-fpm restart
  56. fi
  57. if [ ."$php_version" = ."7.2" ]; then
  58. #copy the php extension .so into the php lib directory
  59. cp ioncube/ioncube_loader_lin_7.2.so /usr/lib/php/20170718
  60. #add the 00-ioncube.ini file
  61. echo "zend_extension = /usr/lib/php/20170718/ioncube_loader_lin_7.2.so" > /etc/php/7.2/fpm/conf.d/00-ioncube.ini
  62. echo "zend_extension = /usr/lib/php/20170718/ioncube_loader_lin_7.2.so" > /etc/php/7.2/cli/conf.d/00-ioncube.ini
  63. #restart the service
  64. service php7.2-fpm restart
  65. fi
  66. if [ ."$php_version" = ."7.4" ]; then
  67. #copy the php extension .so into the php lib directory
  68. cp ioncube/ioncube_loader_lin_7.4.so /usr/lib/php/20190902
  69. #add the 00-ioncube.ini file
  70. echo "zend_extension = /usr/lib/php/20190902/ioncube_loader_lin_7.4.so" > /etc/php/7.4/fpm/conf.d/00-ioncube.ini
  71. echo "zend_extension = /usr/lib/php/20190902/ioncube_loader_lin_7.4.so" > /etc/php/7.4/cli/conf.d/00-ioncube.ini
  72. #restart the service
  73. service php7.4-fpm restart
  74. fi
  75. if [ ."$php_version" = ."8.1" ]; then
  76. #copy the php extension .so into the php lib directory
  77. cp ioncube/ioncube_loader_lin_8.1.so /usr/lib/php/20210902
  78. #add the 00-ioncube.ini file
  79. echo "zend_extension = /usr/lib/php/20210902/ioncube_loader_lin_8.1.so" > /etc/php/8.1/fpm/conf.d/00-ioncube.ini
  80. echo "zend_extension = /usr/lib/php/20210902/ioncube_loader_lin_8.1.so" > /etc/php/8.1/cli/conf.d/00-ioncube.ini
  81. #restart the service
  82. service php8.1-fpm restart
  83. fi