[Loris-dev] Cannot connect to the database

Shen Wang wangshen.mcin at gmail.com
Mon Jan 25 15:05:33 EST 2021


Hi Alfredo,
After you upgrade the PHP version, you need to upgrade some libraries to
support the new PHP version as well.

   1. sudo apt-get install -y php7.3 php7.3-mysql php7.3-xml php7.3-json
   php7.3-mbstring php7.3-gd php-ast
   2. sudo apt-get install -y libapache2-mod-php7.3
   3. sudo a2enmod php7.3
   4. sudo service apache2 restart

I hope these steps will help you.
best
Shen



On Mon, 25 Jan 2021 at 14:52, Morales Pinzon, Alfredo <
AMORALESPINZON at bwh.harvard.edu> wrote:

> Dear LorisDev team,
>
> I upgraded the PHP version for apache from 7.2.28 to 7.3.26 in order to
> avoid errors with trailing-comma in functions. Now that it's upgraded I am
> getting the following error:
>
> ===
> [Sun Jan 24 09:43:47.375992 2021] [php7:notice] [pid 26182] [client
> 216.15.126.108:50170] Could not execute . Stack trace#0
> /var/www/loris/php/libraries/Database.class.inc(106):
> Database->connect('AAA', 'BBB', 'CCC', '111.111.111.11', true)\n#1
> /var/www/loris/php/libraries/NDB_Client.class.inc(66):
> Database::singleton('AAA', 'BBB', 'CCC', '111.111.111.11', true)\n#2
> /var/www/loris/htdocs/index.php(27): NDB_Client->initialize()\n#3 {main}
>
> [Sun Jan 24 09:43:47.376142 2021] [php7:error] [pid 26182] [client
> 216.15.126.108:50170] PHP Fatal error:  Uncaught DatabaseException: Could
> not establish a PDO object using the following values: username: `AAA`,
> dbname: `BBB`, host: `111.111.111.11` and the supplied password. in
> /var/www/loris/php/libraries/Database.class.inc:173\nStack trace:\n#0
> /var/www/loris/php/libraries/Database.class.inc(106):
> Database->connect('AAA', 'BBB', 'CCC', '111.111.111.11', true)\n#1
> /var/www/loris/php/libraries/NDB_Client.class.inc(66):
> Database::singleton('AAA', 'BBB', 'CCC', '111.111.111.11', true)\n#2
> /var/www/loris/htdocs/index.php(27): NDB_Client->initialize()\n#3 {main}\n
> thrown in /var/www/loris/php/libraries/Database.class.inc on line 173
> Merge state
> ===
>
> I manually tested the connection from the LORIS server to the server
> hosting the database and it works. Do you have ideas on how to solve this
> issue? Maybe I’m missing some updates?
>
> I am running Ubuntu Xenial 16.04.4 and LORIS is in version 22.0.0.
>
> Best,
> Alfredo.
> The information in this e-mail is intended only for the person to whom it
> is addressed. If you believe this e-mail was sent to you in error and the
> e-mail contains patient information, please contact the Mass General
> Brigham Compliance HelpLine at
> http://www.massgeneralbrigham.org/complianceline . If the e-mail was sent
> to you in error but does not contain patient information, please contact
> the sender and properly dispose of the e-mail.
>
> _______________________________________________
> Loris-dev mailing list
> Loris-dev at bic.mni.mcgill.ca
> https://mailman.bic.mni.mcgill.ca/mailman/listinfo/loris-dev
>


-- 
Shen Wang
Loris <https://github.com/aces/Loris>  Developer
Montreal Neurological Institute
McGill University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20210125/ec710b15/attachment.html>


More information about the Loris-dev mailing list