Error: syntax error, unexpected ‘Config’ (T_STRING), expecting ‘]’

Hi,
I followed the steps from
Debian 8 “Jessy” with Apache, MariaDB and PHP 5 (by Passbolt)
manual.
The difference is Ubuntu 16 with PHP7
When I do the last step to call the script, I get:
Error: syntax error, unexpected ‘Config’ (T_STRING), expecting ‘]’
#0 /var/www/passbolt/lib/Cake/Core/Configure.php(329): PhpReader->read(‘app’)
#1 /var/www/passbolt/app/Config/bootstrap.php(26): Configure::load(‘app’)
#2 /var/www/passbolt/lib/Cake/Core/Configure.php(98): include(’/var/www/passbo…’)
#3 /var/www/passbolt/lib/Cake/bootstrap.php(432): Configure::bootstrap(true)
#4 /var/www/passbolt/lib/Cake/Console/ShellDispatcher.php(145): require(’/var/www/passbo…’)
#5 /var/www/passbolt/lib/Cake/Console/ShellDispatcher.php(100): ShellDispatcher->_bootstrap()
#6 /var/www/passbolt/lib/Cake/Console/ShellDispatcher.php(54): ShellDispatcher->_initEnvironment()
#7 /var/www/passbolt/lib/Cake/Console/ShellDispatcher.php(65): ShellDispatcher->__construct(Array)
#8 /var/www/passbolt/app/Console/cake.php(52): ShellDispatcher::run(Array)
#9 {main}

Where could be the problem?

Greets,
Dominik

You most likely have a problem with the syntax in your app/Config/app.php.

Error: syntax error, unexpected ‘Config’ (T_STRING), expecting ‘]’

The error means that an array is not closed properly, most likely you have deleted a line.
Try again from a fresh app.php or try to locate the issue.

OK, checked app.php, made it new.
Now again, install does not succeed.
Healthcheck tells me:
Database connection “Mysql” is missing, or could not be created.

Database.php is correct:
class DATABASE_CONFIG {

    public $default = array(
            'datasource' => 'Database/Mysql',
            'persistent' => false,
            'host' => 'localhost',
            'login' => 'root',
            'password' => 'mypass',
            'database' => 'passbolt',
            'prefix' => '',
            'encoding' => 'utf8',
    );

Mysqlshow:

±-------------------+
| Databases |
±-------------------+
| information_schema |
| mysql |
| passbolt |
| performance_schema |
±-------------------+

So DB exists and ist configured…
What next?

Dominik

Check this thread: https://stackoverflow.com/questions/19280245/cakephp-database-connection-mysql-is-missing-or-could-not-be-created#19282764

I tried everything from that post. Nothing worked.

Can you provide more information as it’s hard to debug without having access to the system.
Like php info (from command line) and the apache / mysql / passbolt logs?

Also can you try a separate simple script like

// connect to the database
$con = mysql_connect('localhost','testuser','testpassword') 
    or die('Could not connect to the server!');
 
// select a database:
mysql_select_db('testdb') 
    or die('Could not select a database.');

You know, I’m not a Linux pro.
I’m a Windows Admin.
So if you write me “try a simple script like…” please provide me the info, how to do that.
And where can I find the mentioned logs?
I can’t run “php info” from the shell.
But I found out, that there is an error:
"PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/20151012/pdo_mysql.so’ - /usr/lib/php/20151012/pdo_mysql.so: undefined symbol: pdo_parse_params in Unknown on line 0"
Reinstalled php7.0-mysql with no luck.

There is an issue with your php not being able to connect to mysql.
Unfortunately this is a bit out of scope of the support we provide. I advice having a look at other tutorials on internet to setup a LAMP server on Ubuntu, as there a lot of resources available to do that.
Otherwise you can try to install passbolt using the docker image.

Please open an another request once you’ve managed to get your baseline server working. We try to keep one issue per thread and the original issue is solved.

I don’t know how this docker thing works.
We’ll see.
That’s why I love Windows. Klick Setup.exe, does everything necessary to make it run…

Yes, I understand it’s a bit frustrating to have to install all passbolt components. In the future we will provide such “one click it runs” experience using either debian/ubuntu packages or amazon AMI / google cloud virtual machine.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.