What could be causing wget to repeatedly execute a PHP file specified in a cron job?
The issue could be caused by wget not properly handling the PHP file, resulting in it being executed repeatedly. To solve this, you can add a check in the PHP file to prevent multiple executions by using a lock file. This lock file will ensure that the PHP file is only executed once at a time.
// Check if lock file exists
$lockFile = 'cron.lock';
if (file_exists($lockFile)) {
die('Script is already running.');
}
// Create lock file
file_put_contents($lockFile, '');
// Your PHP code here
// Remove lock file
unlink($lockFile);