You are not logged in.
After update GLPI from 9.5.7 to 10 have error during start GLPI
Parse error: syntax error, unexpected '?', expecting function (T_FUNCTION) or const (T_CONST) in D:\www\domains\htdocs\glpi\src\Features\Inventoriable.php on line 50
Line 50 in that file is
protected ?CommonDBTM $agent = null;
Offline
I have the same problem.
Last edited by employer (2022-04-26 02:07:47)
Offline
What version of PHP are you using? You can check/verify the version used by the web server in Setup > General on the System tab along with the other GLPI system information.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
You are absolutely right.
GLPI was using version 7.4
I forced Linux to use version 8.1 and it worked.
Command:
update-alternatives --set php /usr/bin/php8.1
Thank you
Last edited by employer (2022-04-26 03:11:05)
Offline
OBRIGADO,
Funcionou após o comando.
TKS MAN!
You are absolutely right.
GLPI was using version 7.4
I forced Linux to use version 8.1 and it worked.Command:
update-alternatives --set php /usr/bin/php8.1
Thank you
Offline
Hello @cconard96
GLPI V10.0.10
PHP 8.0.26 ou 8.1.26
same error : line 53
protected ?CommonDBTM $agent = null;
Last edited by ec2311 (2024-02-16 14:54:38)
GLPI 10.0.10
GLPIinventory 1.3.4
Agents : FI (2.6, 2.5) et Glpiagents (1.7)
Offline
ec2311,
As I suggested on your GitHub report, it looks like you are using an older version of PHP for your system than what your web server is currently using.
That line is perfectly valid syntax since PHP 7.4 (not sure why there were reports of issues on 7.4, but it definitely works on 8.0 and newer).
Based on your report, I assume you are using Windows?
Can you provide the full stack trace from the error log?
Are your automatic actions/cron triggered by a Task Scheduler entry? Double check the entry to see if it points to a specific, older version of PHP.
What is the output if you run "php --version" from a command line? Perhaps the PHP path in your PATH variable points to an older version still.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
Hello cconard96
Indeed, all is ok
In fact I was focused on the 'error' which talked about inventory
and I didn't notice the tasks scheduled which were rewritten on the other environnement
Thanks for all
GLPI 10.0.10
GLPIinventory 1.3.4
Agents : FI (2.6, 2.5) et Glpiagents (1.7)
Offline