How to resolve this?
Error string:

$req = $this->makeApiCall('users/search/?query='.$username)['users'][0]; 

PHP 5.3, Ubuntu 12.04

  • one
    If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

1 answer 1

You have a PHP version lower than 5.5, and when declaring an array you cannot immediately use its elements.

Add the following to the top of .htaccess :

 #PHP 5.5 AddHandler application/x-httpd-php55 .php 

Or change PHP to:

 $req = $this->makeApiCall('users/search/?query='.$username); $req = $req['users'][0];