Problème à la cron
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.
Question

Problème à la cron

by
pppplus
Created on 2017-03-10 13:42:17 (edited on 2024-09-04 11:42:59) in Hébergements Web

Bonjour

Suite à une mise à jour de PHP vers 5.6, j'ai un problème avec les cron et mysql_connect (idem avec mysqli_connect).

Configuration :
Centos 6.8
PHP 5.6
directadmin
php1_release=5.6
php1_mode=php-fpm


Donc, si je lance en ssh la commande, ça marche parfaitement
php /home/castor/domains/mydomain.com/cron/nettoyage.php

Par contre, si le script est lancé en ssh de la même façon, ça me sort l'erreur
Call to undefined function mysql_connect()

Une idée ?
En recherchant, ça parle de version php différente pour l'exécution en ligne de commande.
Mais en ssh, ça marche, donc, ça devrait aussi se lancer depuis une simple tâche cron.

Merci d'avance pour votre aide.


1 Reply ( Latest reply on 2017-03-10 21:31:22 by
pppplus
)

Problème réglé, j'ai un conflit entre plusieurs versions PHP.
Je dois faire un peu de nettoyage des anciennes versions.

En indiquant le chemin précis /usr/local/php56/bin/php pour appeler la tâche cron, elle passe correctement.