Reputation: 21
I am working on a PHP project in OVH server. I want to start a script once a day to push an alert.
The script works when i call it manually myself. But when i wait the CRON, i always got the error : exitcode 255 in my logs.
cron.php
include('/home/name/path/bdd.php');
error_reporting( E_ALL );
ini_set('display_errors', '1');
$var = "INSERT INTO `alerts`(`alert_text`, `alert_user`, `alert_link`, `alert_date`) VALUES (:text, :id, :link, NOW())";
$stmt = $pdo->prepare($var);
//Lancement
$insert = $stmt->execute(array(
':text' => 'hello',
':id' => '2',
':link' => '#'
));
OVH logs
[2023-12-31 13:42:02] ## OVH ## START - 2023-12-31 13:42:02.401426 executing: /usr/local/php7.3/bin/php /home.XXX/name/path/cron.php
[2023-12-31 13:42:02]
[2023-12-31 13:42:02] ## OVH ## END - 2023-12-31 13:42:02.455282 exitcode: 255
I tried to change include paths for absolute, to modify my functions or to work procedurally. Nothing change.
Upvotes: 2
Views: 171