1
0

apcu.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. # https://oneinstack.com
  9. # https://github.com/lj2007331/oneinstack
  10. Install_APCU() {
  11. cd $oneinstack_dir/src
  12. tar xzf apcu-$apcu_version.tgz
  13. cd apcu-$apcu_version
  14. make clean
  15. $php_install_dir/bin/phpize
  16. ./configure --with-php-config=$php_install_dir/bin/php-config
  17. make -j ${THREAD} && make install
  18. if [ -f "`$php_install_dir/bin/php-config --extension-dir`/apcu.so" ];then
  19. cat > $php_install_dir/etc/php.d/ext-apcu.ini << EOF
  20. [apcu]
  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 installed 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. }