eaccelerator-0.9.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/bin/bash
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # BLOG: https://blog.linuxeye.com
  4. #
  5. # Notes: OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+
  6. #
  7. # Project home page:
  8. # http://oneinstack.com
  9. # https://github.com/lj2007331/oneinstack
  10. Install_eAccelerator-0-9()
  11. {
  12. cd $oneinstack_dir/src
  13. src_url=https://github.com/downloads/eaccelerator/eaccelerator/eaccelerator-0.9.6.1.tar.bz2 && Download_src
  14. tar jxf eaccelerator-0.9.6.1.tar.bz2
  15. cd eaccelerator-0.9.6.1
  16. make clean
  17. $php_install_dir/bin/phpize
  18. ./configure --enable-eaccelerator=shared --with-php-config=$php_install_dir/bin/php-config
  19. make && make install
  20. if [ -f "$php_install_dir/lib/php/extensions/`ls $php_install_dir/lib/php/extensions | grep zts`/eaccelerator.so" ];then
  21. mkdir /var/eaccelerator_cache;chown -R ${run_user}.$run_user /var/eaccelerator_cache
  22. cat >> $php_install_dir/etc/php.ini << EOF
  23. [eaccelerator]
  24. zend_extension="$php_install_dir/lib/php/extensions/`ls $php_install_dir/lib/php/extensions | grep zts`/eaccelerator.so"
  25. eaccelerator.shm_size="64"
  26. eaccelerator.cache_dir="/var/eaccelerator_cache"
  27. eaccelerator.enable="1"
  28. eaccelerator.optimizer="1"
  29. eaccelerator.check_mtime="1"
  30. eaccelerator.debug="0"
  31. eaccelerator.filter=""
  32. eaccelerator.shm_max="0"
  33. eaccelerator.shm_ttl="0"
  34. eaccelerator.shm_prune_period="0"
  35. eaccelerator.shm_only="0"
  36. eaccelerator.compress="0"
  37. eaccelerator.compress_level="9"
  38. eaccelerator.keys = "disk_only"
  39. eaccelerator.sessions = "disk_only"
  40. eaccelerator.content = "disk_only"
  41. EOF
  42. echo "${CSUCCESS}Accelerator module install successfully! ${CEND}"
  43. cd ..
  44. [ -z "`grep 'kernel.shmmax = 67108864' /etc/sysctl.conf`" ] && echo 'kernel.shmmax = 67108864' >> /etc/sysctl.conf
  45. sysctl -p
  46. [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
  47. else
  48. echo "${CFAILURE}Accelerator module install failed, Please contact the author! ${CEND}"
  49. fi
  50. cd ..
  51. }