The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
sintaxe error
#1
Hi everybody,

I moved my site to other PC and now I get the error in this line:

//adding more ids to this array allows people to access everything, whether offline or not. Use caution.
$master_account = [1];


The message of error: Parse error: syntax error, unexpected '[' in /home/smsrio/public_html/subhue/pacientesocial/users/init.php on line 54

Some idea about this ?

Thanks
  Reply
#2
I do a test and the sintaxe below is the same:

$master_account [] = 1;

The result with print_r is:

Array ( [0] => 1 )

In both sintaxes below:

$master_account = [1];
$master_account [] = 1;

The result is the same.


  Reply
#3
when you did the move did you use the installer?
  Reply
#4
No, just copy to the new server.
I think that problem is caused by PHP version, is different of developer server.
  Reply
#5
firstly make sure init.php isnt same as dev and has the right credentials for the new server, paste a copy of your init to paste bin or hastebin and link it here we can have a look, php version should be 5.3 or higher, ive tested past 7 without issue, you might want to try clean install aswell
  Reply
#6
Thank you for you help,

My Production Environment has PHP 5.3.27 version,

I resolve this with: $master_account [] = 1;

It's worked.





  Reply
#7
Your version probably just doesn't recognize the syntax. Your fix does the same thing, as would
Code:
$master_account = array(1);
The code that doesn't work is a more recently added shorthand but all 3 do the same thing.
  Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)