下面由宝塔面板教程栏目给大家介绍通过计划任务定期释放php占用的内存的方法,希望对需要的朋友有所帮助!
通过计划任务定期释放PHP占用的内存
在计划任务中添加任务,选择周期,如每周一 3时30分执行
选执行Shell脚本,粘贴以下Shell脚本
立即学习“PHP免费学习笔记(深入)”;
if [ -f /etc/init.d/php-fpm-52 ];then service php-fpm-52 reload fi if [ -f /etc/init.d/php-fpm-53 ];then service php-fpm-53 reload fi if [ -f /etc/init.d/php-fpm-54 ];then service php-fpm-54 reload fi if [ -f /etc/init.d/php-fpm-55 ];then service php-fpm-55 reload fi if [ -f /etc/init.d/php-fpm-56 ];then service php-fpm-56 reload fi if [ -f /etc/init.d/php-fpm-70 ];then service php-fpm-70 reload fi myDate=`date +"%Y-%m-%d %H:%M:$S"` echo "★[$myDate] PHP内存回收成功!" echo '------------------------------------------------------------------------------';
以上就是如何通过计划任务定期释放PHP占用的内存的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号