1
0

apcu.sh 917 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/bash
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # Blog: http://blog.linuxeye.com
  4. Install_APCU()
  5. {
  6. cd $oneinstack_dir/src
  7. . ../functions/download.sh
  8. . ../options.conf
  9. src_url=http://pecl.php.net/get/apcu-$apcu_version.tgz && Download_src
  10. tar xzf apcu-$apcu_version.tgz
  11. cd apcu-$apcu_version
  12. make clean
  13. $php_install_dir/bin/phpize
  14. ./configure --with-php-config=$php_install_dir/bin/php-config
  15. make && make install
  16. if [ -f "$php_install_dir/lib/php/extensions/`ls $php_install_dir/lib/php/extensions | grep zts`/apcu.so" ];then
  17. cat >> $php_install_dir/etc/php.ini << EOF
  18. extension = apcu.so
  19. apc.enabled=1
  20. apc.shm_size=32M
  21. apc.ttl=7200
  22. apc.enable_cli=1
  23. EOF
  24. [ "$Apache_version" != '1' -a "$Apache_version" != '2' ] && service php-fpm restart || service httpd restart
  25. /bin/cp apc.php $home_dir/default
  26. else
  27. echo -e "\033[31meAPCU module install failed, Please contact the author! \033[0m"
  28. fi
  29. cd ../../
  30. }