Tâches automatiques (cron) - Cron et json_encode
... / Cron et json_encode
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Frage

Cron et json_encode

Von
Lexarino
Erstellungsdatum 2021-06-07 14:46:42 (edited on 2024-09-04 11:41:11) in Tâches automatiques (cron)

Bonjour la communauté,

J'ai un souci sur un script qui s'exécute en cron.
Il s'agît d'écrire un tableau de données dans un fichier JSON via la fonction json_encode de php. Il y a plusieurs tableaux et plusieurs fichiers ainsi générés : certains s'écrivent correctement (le .json a du contenu) et d'autres sont vides quand le script s'exécute en cron. Aucun problème quand je lance le script via l'url en direct.

J'ai pensé à un souci de version de php : Version sur mon serveur : 5.4, version du script cron : 5.6 mais pas de modification de la fonction avant php 7.
Et encore plus étrange le fichier xml lui aussi rédigé dans la même boucle s'écrit correctement.

Vous avez une idée du problème ?


Antworten sind derzeit für diese Frage deaktiviert.