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 2011-05-29 23:32:36

frankske_699
Member
Registered: 2011-05-29
Posts: 3

Fatal error: Cannot use string offset as an array in update.php

I did a full install of 0.80, but when I try to do the install, I only get a blank page.  I raised the mem limit (as suggested in the other topic), but that didn't help.  I still get the blank page.

I removed 0.80 and did a fresh install of 0.78.5 and that worked perfect.
I then tried an upgrade from 0.78.5 to 0.80 but now I get an error when it tries to update the database:

Fatal error: Cannot use string offset as an array in /path_to_my_install/install/update.php on line 841

How can I fix this?

Last edited by frankske_699 (2011-05-29 23:34:10)

Offline

#2 2011-05-30 09:19:00

MoYo
GLPI - Lead
From: Poitiers
Registered: 2004-09-13
Posts: 14,513
Website

Re: Fatal error: Cannot use string offset as an array in update.php

Could you give use more informations about your environnement ?

http://www.glpi-project.org/forum/viewt … p?id=10279


MoYo - Julien Dombre - Association INDEPNET
Contribute to GLPI :    Support     Contribute     References     Freshmeat

Offline

#3 2011-06-01 04:56:15

carlos.costa
Member
Registered: 2010-12-14
Posts: 24

Re: Fatal error: Cannot use string offset as an array in update.php

The line is giving error (841) in my update GLPI to 0.80.0, is this:

echo "<br><h3>".$LANG['install'][4]."</h3>";

What is wrong with this line? What must I do to upgrade to the 0.80.0 is completed successfully? Please help me. Thanks.

Offline

#4 2011-06-01 08:32:42

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: Fatal error: Cannot use string offset as an array in update.php

In glpi/locales/ have you the file en_GB.php ?
and pt_BR.php for carlos.costa


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#5 2011-06-01 13:08:41

carlos.costa
Member
Registered: 2010-12-14
Posts: 24

Re: Fatal error: Cannot use string offset as an array in update.php

Yes. The two languages are in the folder locales.

Offline

#6 2011-06-02 11:09:28

JMD
GLPI - Lead
Registered: 2004-09-13
Posts: 9,180
Website

Re: Fatal error: Cannot use string offset as an array in update.php


JMD / Jean-Mathieu Doléans - Glpi-project.org - Association Indepnet
Apportez votre pierre au  projet GLPI   : Soutenir

Offline

#7 2011-06-03 01:29:02

thgbrb
Member
Registered: 2011-06-03
Posts: 1

Re: Fatal error: Cannot use string offset as an array in update.php

Hey you,

Today, I have updated my glpi and I got the same error. After some checks, I have updated my PHP to 5.3 and the problem was solved.
I hope that help you.

br,
thiago

Offline

#8 2011-06-08 15:04:32

Lupick
Member
Registered: 2008-01-24
Posts: 25

Re: Fatal error: Cannot use string offset as an array in update.php

Same problem here upgrading from 0.78.5

I'm on centos 5.6 wiyj php 5.1 but I can't upgrade to 5.3

Any Idea how to solve it?

thank you

Luca

Offline

#9 2011-06-08 16:47:47

voss
Member
Registered: 2007-08-27
Posts: 21

Re: Fatal error: Cannot use string offset as an array in update.php

Edit /locales/your_locale.php and insert "global $LANG" as a line before $LANG=array();

Offline

#10 2011-06-08 17:03:35

Lupick
Member
Registered: 2008-01-24
Posts: 25

Re: Fatal error: Cannot use string offset as an array in update.php

voss wrote:

Edit /locales/your_locale.php and insert "global $LANG" as a line before $LANG=array();

If I do this change I've the following error:

Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /var/www/html/glpi/locales/en_GB.php on line 32


L.

Offline

#11 2011-06-08 17:26:21

voss
Member
Registered: 2007-08-27
Posts: 21

Re: Fatal error: Cannot use string offset as an array in update.php

Sorry "global $LANG;" instead of "global $LANG". Note the semicolon.

Offline

#12 2011-06-08 17:31:34

Lupick
Member
Registered: 2008-01-24
Posts: 25

Re: Fatal error: Cannot use string offset as an array in update.php

voss wrote:

Sorry "global $LANG;" instead of "global $LANG". Note the semicolon.

GREAT!..!

Problema solved!..


thank you

Luca

Offline

#13 2011-06-08 23:31:57

JMD
GLPI - Lead
Registered: 2004-09-13
Posts: 9,180
Website

Re: Fatal error: Cannot use string offset as an array in update.php

Humm i  think that the real problem comes from the install.php file

Could you please test another one with this modification :

// load language

function loadLang($LANGuage) {

        if (isset($LANG)){   
                unset($LANG);
        }       

        global $LANG;
....



The actual file unset the $lang at the wrong time...


JMD / Jean-Mathieu Doléans - Glpi-project.org - Association Indepnet
Apportez votre pierre au  projet GLPI   : Soutenir

Offline

Board footer

Powered by FluxBB