Home  >  Article  >  php教程  >  用crond执行php脚本导致同服务器上的php-fpm全部挂掉,网站502如

用crond执行php脚本导致同服务器上的php-fpm全部挂掉,网站502如

WBOY
WBOYOriginal
2016-06-06 19:36:041551browse

最近遇到这个问题一直没 解决 网站 的日志文件、数据库文件需要定时备份。我选用了百度云来实现、使用php 脚本 在shell里面写了 /usr/local/php xxx.php(百度云备份的php文件) ... 定时 执行 但是每次 执行 完毕,同 服务器 上的 网站 就会挂掉502,php-fpm

最近遇到这个问题一直没解决

 

网站的日志文件、数据库文件需要定时备份。我选用了百度云来实现、使用php脚本

在shell里面写了 /usr/local/php xxx.php(百度云备份的php文件) ...

 

定时执行

 

但是每次执行完毕,同服务器上的网站就会挂掉502,php-fpm需要重新启动才行

 

但是我后来在shell里面加上了 service php-fpm restart 。

 

直接手动执行 shell脚本,可以看到php-fpm重启成功了

 

但是用crond(root权限)来执行同一个shell却无法重启php-fpm

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn