我正在尝试在我的基于 linux 的服务器中运行这个 php 脚本。
$today = strtotime("today");
$tommorow = date("Y-m-d", strtotime("+1day",$today));
$today = date("Y-m-d");
//Endless loop because the data here updates around the clock
while(1){
while (time() <= strtotime("$tommorw 8:00PM")){
sleep(30);
flush();
}
}//end 24 h loop
//save the file as a date file and delete it's content
//move on to the next day
$today = strtotime("today");
$tommorow = date("Y-m-d", strtotime("+1day",$today));
}//end of endless loop
如果我从一个简单的浏览器运行它,它就可以正常工作(当然,当我关闭它时它会停止工作)。
我正在尝试通过 perl 脚本运行它
chdir("mydir");
exec('indices.php'); #tryed also system("php indices.php");
并像这样运行 perl 脚本
./PROMadadim.pl >> ./PROMadadim.log &
但是当我尝试从服务器运行它时它不起作用。