apcu.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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_APCU() {
  11. cd $oneinstack_dir/src
  12. src_url=http://pecl.php.net/get/apcu-$apcu_version.tgz && Download_src
  13. tar xzf apcu-$apcu_version.tgz
  14. cd apcu-$apcu_version
  15. make clean
  16. $php_install_dir/bin/phpize
  17. ./configure --with-php-config=$php_install_dir/bin/php-config
  18. make && make install
  19. if [ -f "`$php_install_dir/bin/php-config --extension-dir`/apcu.so" ];then
  20. cat >> $php_install_dir/etc/php.ini << EOF
  21. extension = apcu.so
  22. apc.enabled=1
  23. apc.shm_size=32M
  24. apc.ttl=7200
  25. apc.enable_cli=1
  26. EOF
  27. [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
  28. /bin/cp apc.php $wwwroot_dir/default
  29. echo "${CSUCCESS}APCU module install successfully! ${CEND}"
  30. cd ..
  31. rm -rf apcu-$apcu_version
  32. else
  33. echo "${CFAILURE}APCU module install failed, Please contact the author! ${CEND}"
  34. fi
  35. cd ..
  36. }