eaccelerator-1.0-dev.sh 2.0 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-1-0-dev()
  11. {
  12. cd $oneinstack_dir/src
  13. src_url=https://github.com/eaccelerator/eaccelerator/tarball/master && Download_src
  14. /bin/mv master eaccelerator-eaccelerator-42067ac.tar.gz
  15. tar xzf eaccelerator-eaccelerator-42067ac.tar.gz
  16. cd eaccelerator-eaccelerator-42067ac
  17. make clean
  18. $php_install_dir/bin/phpize
  19. ./configure --enable-eaccelerator=shared --with-php-config=$php_install_dir/bin/php-config
  20. make && make install
  21. if [ -f "$php_install_dir/lib/php/extensions/`ls $php_install_dir/lib/php/extensions | grep zts`/eaccelerator.so" ];then
  22. mkdir /var/eaccelerator_cache;chown -R ${run_user}.$run_user /var/eaccelerator_cache
  23. cat >> $php_install_dir/etc/php.ini << EOF
  24. [eaccelerator]
  25. zend_extension="$php_install_dir/lib/php/extensions/`ls $php_install_dir/lib/php/extensions | grep zts`/eaccelerator.so"
  26. eaccelerator.shm_size="64"
  27. eaccelerator.cache_dir="/var/eaccelerator_cache"
  28. eaccelerator.enable="1"
  29. eaccelerator.optimizer="1"
  30. eaccelerator.check_mtime="1"
  31. eaccelerator.debug="0"
  32. eaccelerator.filter=""
  33. eaccelerator.shm_max="0"
  34. eaccelerator.shm_ttl="0"
  35. eaccelerator.shm_prune_period="0"
  36. eaccelerator.shm_only="0"
  37. eaccelerator.compress="0"
  38. eaccelerator.compress_level="9"
  39. eaccelerator.keys = "disk_only"
  40. eaccelerator.sessions = "disk_only"
  41. eaccelerator.content = "disk_only"
  42. EOF
  43. echo "${CSUCCESS}Accelerator module install successfully! ${CEND}"
  44. cd ..
  45. [ -z "`grep 'kernel.shmmax = 67108864' /etc/sysctl.conf`" ] && echo 'kernel.shmmax = 67108864' >> /etc/sysctl.conf
  46. sysctl -p
  47. [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
  48. else
  49. echo "${CFAILURE}Accelerator module install failed, Please contact the author! ${CEND}"
  50. fi
  51. cd ..
  52. }