You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2022-04-25 14:43:09

ferromon
Member
Registered: 2021-11-12
Posts: 4

Error starting GLPI 10 after update from 9.5.7

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

#2 2022-04-26 02:07:11

employer
Member
Registered: 2017-09-26
Posts: 11

Re: Error starting GLPI 10 after update from 9.5.7

I have the same problem.

Last edited by employer (2022-04-26 02:07:47)

Offline

#3 2022-04-26 02:17:19

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,809
Website

Re: Error starting GLPI 10 after update from 9.5.7

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

#4 2022-04-26 03:10:37

employer
Member
Registered: 2017-09-26
Posts: 11

Re: Error starting GLPI 10 after update from 9.5.7

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

#5 2022-08-17 16:16:09

evertonsouza
Member
Registered: 2021-01-15
Posts: 6

Re: Error starting GLPI 10 after update from 9.5.7

OBRIGADO,
Funcionou após o comando.

TKS MAN!

employer wrote:

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

#6 2024-02-16 10:40:29

ec2311
Member
Registered: 2016-04-07
Posts: 352

Re: Error starting GLPI 10 after update from 9.5.7

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

#7 2024-02-17 01:48:20

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,809
Website

Re: Error starting GLPI 10 after update from 9.5.7

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

#8 2024-02-19 10:31:22

ec2311
Member
Registered: 2016-04-07
Posts: 352

Re: Error starting GLPI 10 after update from 9.5.7

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 sad

Thanks for all


GLPI 10.0.10
GLPIinventory 1.3.4

Agents : FI (2.6, 2.5) et Glpiagents (1.7)

Offline

Board footer

Powered by FluxBB