eaccelerator-1.0-dev.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. cd $oneinstack_dir/src
  12. src_url=https://github.com/eaccelerator/eaccelerator/tarball/master && Download_src
  13. /bin/mv master eaccelerator-eaccelerator-42067ac.tar.gz
  14. tar xzf eaccelerator-eaccelerator-42067ac.tar.gz
  15. cd eaccelerator-eaccelerator-42067ac
  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/bin/php-config --extension-dir`/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/bin/php-config --extension-dir`/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. }