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 &
しかし、サーバーから実行しようとすると機能しません。