2011-10-03 18:19
浏览 62

Cron Job没有通过PHP脚本运行

Firstly, I have built PHP scripts that run as a cron job when I set it up in linux and it works fine.

What I am doing in the script is writing to a file which isn't being done but works fine via CURL in terminal.

example (the first thing that happens in the script) :

$fp2 = fopen('FeedLog.csv', 'w');

fputcsv($fp2,array("Started Cron",date("F j, Y, g:i a"),0));

I feel like there is some sort of permission issue? I have set both the script and the file its writing to, to 777.

There are no errors or anything in logs nor output.

图片转代码服务由CSDN问答提供 功能建议

首先,我在linux中设置了作为cron作业运行的PHP脚本,它工作正常 。 </ p>

我在脚本中所做的是写入一个未完成的文件但通过终端中的CURL正常工作。</ p>

示例( 在脚本中发生的第一件事情:</ p>

 #!/ usr / bin / php 
 $ fp2 = fopen('FeedLog.csv',  'w'); 
ff以及($ fp2,数组(“已启动的Cron”,日期(“F j,Y,g​​:ia”),0)); 
 </ code> </ pre> 

我觉得有某种许可问题? 我已将脚本及其写入文件设置为777。</ p>

日志和输出中没有错误或任何内容。</ p> </ div>

1条回答 默认 最新

相关推荐 更多相似问题