You are not logged in.
Bonjour,
Sur mon installation (détails ci dessous), la réalisation des actions automatiques en cli ne marchaient pas
J'ai bien ajouté la tache en cron.
Voici le msg d'erreur dans php-error.log:
-----
[2019-11-30 23:48:02] glpiphplog.ERROR: Toolbox::userErrorHandlerNormal() in /var/www/restricted/ssh/piloteimmo/www/portail/glpi/inc/toolbox.class.php line 659
*** PHP Notice(8): Undefined index: SCRIPT_FILENAME
Backtrace :
inc/autoload.function.php:55
inc/includes.php:150 isAPI()
front/cron.php:38 include()
{"user":"@web27"}
---
En cherchant un peu dans les fichiers php cité, puis sur le net, j'en suis arrivé à rajouter cette ligne dans inc/autoload.function.php
Ligne 55 / fonction IsAPI():
Rajout de :
if (!isset($_SERVER["SCRIPT_FILENAME"]) || empty($_SERVER["SCRIPT_FILENAME"])) {
return false;
Plus de message d'erreur, mais les actions automatiques ne se lançaient toujours pas
... Cela n'a pas tout résolu...
Je n'avais plus de message d'erreur, mais je m'apercevais que le cron ne s’exécuter pas : le cron "serveur" fonctionne bien, par contre le scripte cron.php ne donne pas de bon résultat.
En cherchant encore un peu, j'ai compris que toujours dans le fichier : inc/autoload.function.php ligne 45,
la fonction isCommandLine() ne retournait pas le bonne valeur
... En cherchant encore un peu, j'ai modifier la fonction isCommandLine() :
//return (PHP_SAPI == 'cli');
==>
return (!isset($_SERVER['SERVER_SOFTWARE']) && (php_sapi_name() == 'cli' || (is_numeric($_SERVER['argc']) && $_SERVER['argc'] > 0)));
Et là, tout marche
Bug, problème de configuration ? ... Je précise bien que je n'aime pas du tout devoir modifier le php de glpi, car maintenant je tremble pour les prochaines mises à jour
Mes paramètres serveur :
Server API : CGI/FastCGI
GLPI 9.4.3 (/glpi => /var/www/restricted/ssh/XXXXX/www/portail/glpi)
Installation mode: TARBALL
Server
Operating system: Linux web27 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u5 (2019-08-11) x86_64
PHP 7.1.18 cgi-fcgi (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, bcmath, calendar, cgi-fcgi, ctype, curl, date,
dom, exif, fileinfo, filter, ftp, gd, hash, iconv, imap, json, ldap, libxml, mbstring, mcrypt, mysqli, mysqlnd, openssl, pcre,
pdo_mysql, pdo_sqlite, posix, readline, session, soap, sqlite3, standard, tidy, tokenizer, xml, xmlreader, xmlwriter, xsl, zip,
zlib)
Setup: max_execution_time="60" memory_limit="1200M" post_max_size="1000M" safe_mode="" session.save_handler="files"
upload_max_filesize="1000M"
Software: Apache (Apache Server at portail.pilote.immo Port 80)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:70.0) Gecko/20100101 Firefox/70.0
Server Software: Debian 9.8
Server Version: 10.1.38-MariaDB-0+deb9u1
Server SQL Mode:
Parameters: XXXXX@web27/XXXXX
Host info: web27 via TCP/IP
mysqli extension is installed
ctype extension is installed
fileinfo extension is installed
json extension is installed
mbstring extension is installed
iconv extension is installed
zlib extension is installed
curl extension is installed
gd extension is installed
simplexml extension is installed
xml extension is installed
ldap extension is installed
imap extension is installed
Zend OPcache extension is installed
exif extension is installed
APCu extension is not present
xmlrpc extension is not present
CAS extension is not present
Database version seems correct (10.1.38) - Perfect!Database version seems correct (10.1.38) - Perfect!
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files/_log : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/config : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files/_dumps : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files/_sessions : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files/_cron : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files/_graphs : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files/_lock : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files/_plugins : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files/_tmp : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files/_cache : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files/_rss : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files/_uploads : OK
OK/var/www/restricted/ssh/XXXXX/www/portail/glpi/files/_pictures : OK
Web access to files directory is protectedWeb access to files directory is protected : OK
Libraries
htmLawed version 1.2.4 in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/lib/htmlawed)
phpmailer/phpmailer version 6.0.7 in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.2 in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/simplepie/simplepie/library)
tecnickcom/tcpdf version 6.2.26 in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/michelf/php-markdown/Michelf)
true/punycode in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/true/punycode/src)
iamcal/lib_autolink in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/iamcal/lib_autolink)
sabre/vobject in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/sabre/vobject/lib)
zendframework/zend-cache in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/zendframework/zend-cache/src)
zendframework/zend-i18n in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/zendframework/zend-i18n/src)
zendframework/zend-serializer in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/zendframework/zend-serializer/src)
monolog/monolog in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/sebastian/diff/src)
elvanto/litemoji in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/elvanto/litemoji/src)
symfony/console in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/symfony/console)
leafo/scssphp in (/var/www/restricted/ssh/XXXXX/www/portail/glpi/vendor/leafo/scssphp/src)
SQL replicas
Not active
Notifications
Way of sending emails: PHP
Mails receivers
Plugins list
fields Name: Champs supplémentaires Version: 1.10.1 State: Enabled
behaviors Name: Comportements Version: 2.2.1 State: Enabled
genericobject Name: Gestion d'objets Version: 2.7.0 State: Enabled
reports Name: Rapports Version: 1.13.1 State: Enabled
Offline
quelle commande tu passes dans ton CRON ?
Offline
et avec quel utilisateur tu lances ton CRON ?
Offline
commande cron :
*/5 * * * * /var/www/restricted/ssh/XXXXX/cgi-bin/php /var/www/restricted/ssh/XXXXX/www/portail/glpi/front/cron.php --debug
utilisateur :
mon utilisateur qui fait fonctionner apache et php,
Avec les modifs que j'ai faites, ca marche... donc je pense que ce n'est pas un problème de cron / user
mais bien un paramétrage de glpi
Offline