日期:2014-05-16  浏览次数:20671 次

linux中crontab 执行php为什么没有写文件,有执行的
<?php
  $count=0;
  if(file_exists("count.txt"))   //判断是否存在count.txt文件
  {
    $count=file_get_contents("count.txt");  //取出文件count.txt中的内容
  }
  $count++;
 
  file_put_contents("count.txt",$count);  //讲$count的值写入count.txt文件中
?>

自己手动执行,就看到+1效果,可是crontab,就没反应,日志也没看到错误,文件也加777权限了 why???

qq17275-03992
------解决方案--------------------
1、corn的执行用户是否有权限
2、corn中加入脚本使用绝对路径