Suitecrm 8 install problem Mysql connection

Hi everyone,

I’m trying to install suitecrm 8 but i’m facing mysql connection problem.
I have already searched on the forum and here are some elements that I have already checked :

  • pdo and mysqli are activated
  • tested with php 7.4 and php 8
  • mysql version is ok
  • i’ve put rights on folders and files
  • credentials are correct and i’m suceed to connect mysql with command
  • tested with localhost and 127.0.0.1

By web interface the error message is :

and by cli install :

Running: check-db-connection
10:08:34 ERROR [app] An error occurred while checking the Database Host Connection SQLSTATE[HY000] [2005] Unknown MySQL server host ‘localhost:3306’ (-2)
step: check-db-connection | status: failed
Could not connect to db

With mysql command, connection is ok :

#mysql -h127.0.0.1 -uXXX -pXXX --port=3306
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10900162
Server version: 10.5.13-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MariaDB [XXX]>

Thank for your help :slight_smile:

Hi @nicopoal,

Thank you for trying out SuiteCRM 8.

Your issues seems to be similar to one others users also faced. A fix for it should come soon.

Meanwhile, if you feel comfortable with it, could you try the fix proposed on this post here, please?

Hope this helps

hi @clemente.raposo ;
thank you for your reply. I’m sorry I forgot to mention it, but I already tried this solution before and it didn’t work :-/

Hi @nicopoal,

No problem. After trying the solution above did you try just passing the db_host as localhost, and not setting the db_port?

oh wow it looks like it worked on web interface, but now i have an empty error message on top of screen, and this error in chrome console :

Hi @nicopoal,

Hm… strange, could you try again please?

yes, I tried 3 times, even in private browsing , same result error 500 in console.

is there something to do on the server first ?
for now i have simply copied the files from the suitecrm8 zip, put the correct rights on folders and files and ran a “composer install”

Hi @nicopoal,

Thank you, could you check the following logs, to see if there is any info that could help, please?

  • logs/prod/prod.log
  • public/legacy/suitecrm.log
  • php error log

i’ve found some info on prod.log.
so I went back from version 8.1 of php to version 7.4 and the installation ended with a success message.

now trying to login and i have 404 error on graphql in console and sometimes also another 500 error

GET http://xxx-myurl-xxx/public/legacy/index.php?module=Users&action=SetTimezone 500 (Internal Server Error)

This from prod log

[2021-12-13 15:41:09] php.INFO: Deprecated: Return type of SugarDateTime::createFromFormat($format, $time, $timezone = null) should either be compatible with DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice {“exception”:"[object] (ErrorException(code: 0): Deprecated: Return type of SugarDateTime::createFromFormat($format, $time, $timezone = null) should either be compatible with DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice at XXX-MYPATH-XXX/public/legacy/include/SugarDateTime.php:111)"} []
[2021-12-13 15:41:09] php.INFO: Deprecated: str_ireplace(): Passing null to parameter #1 ($search) of type array|string is deprecated {“exception”:"[object] (ErrorException(code: 0): Deprecated: str_ireplace(): Passing null to parameter #1 ($search) of type array|string is deprecated at XXX-MYPATH-XXX/public/legacy/include/utils/db_utils.php:135)"} []
[2021-12-13 15:41:09] php.INFO: Deprecated: str_ireplace(): Passing null to parameter #2 ($replace) of type array|string is deprecated {“exception”:"[object] (ErrorException(code: 0): Deprecated: str_ireplace(): Passing null to parameter #2 ($replace) of type array|string is deprecated at XXX-MYPATH-XXX/public/legacy/include/utils/db_utils.php:135)"} []
[2021-12-13 15:41:09] php.CRITICAL: Fatal Compile Error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax {“exception”:"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Compile Error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax at XXX-MYPATH-XXX/public/legacy/install/performSetup.php:782)"} []
[2021-12-13 15:41:09] request.CRITICAL: Uncaught PHP Exception Symfony\Component\ErrorHandler\Error\FatalError: “Compile Error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax” at XXX-MYPATH-XXX/public/legacy/install/performSetup.php line 782 {“exception”:"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Compile Error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax at XXX-MYPATH-XXX/public/legacy/install/performSetup.php:782)"} []

ok i had a problem on document root folder.
now i can login and some pages work and other don’t. Seems all pages with “legacy” on url have a problem 404

Hi @nicopoal,

Glad you were able to find the issue. For the legacy ones, could you check the RewriteBase on your public/legacy folder, please? since your url is something like http://xxx-myurl-xxx/public/legacy/, RewriteBase should have the following value /public/legacy

By the way, if possible, for security purposes it is best to point your vhost directly to public folder. So that you can access your crm directly on http://xxx-myurl-xxx/. Note if you do this change the RewriteBase needs to be changed to /legacy

1 Like

i’ve modified rewritebase on htacess of public legacy folder. it was better but i’ve lost css and js.

so i’ve tried in root folder and legacy folder : sudo chmod -R 755
sudo chmod -R 775 cache custom data modules themes upload
sudo chmod 775 config_override.php

and it seems working :slight_smile:

thanks you VERY MUCH for your help. but i think i’ll wait a few before put V8 in production :slight_smile:

have a nice day

i still have some problem on url’s in the studio modules icons (labels, subpanels, relationship etc)

Hi @nicopoal,

Hm… could you check if the site_url in public/legacy/config.php, please?

Does it look something like http://xxx-myurl-xxx/public (assuming you haven’t yet changed the vhost to point to public)

hello Sir
I have an error please help me to solve this problem
Parse error : syntax error, unexpected ‘=’ in C:\xampp\htdocs\hamza\SuiteCRM-8.2.1\core\backend\Install\LegacyHandler\InstallHandler.php on line 263

 public function checkDBConnection(array $inputArray): bool
    {
        “mysql:host=” . $inputArray[“db_host”] . “:” . $inputArray[“db_port”] . “;”,

        try {
            new PDO(
                "mysql:host=" . $hostString . ";",
                $inputArray['db_username'],
                $inputArray['db_password']
            );
        } catch (PDOException $e) {
            $this->logger->error('An error occurred while checking the Database Host Connection ' . $e->getMessage());

            return false;
        }

        return true;
    }

There are some lines missing there, please compare with the original:

SuiteCRM-Core/InstallHandler.php at master · salesagility/SuiteCRM-Core · GitHub

You can fix the install issue "Compile Error: $GLOBALS can only be modified using the $GLOBALS[$name] = $value syntax " with this code in the file performSetup.php:
//$GLOBALS = $varStack[‘GLOBALS’];
foreach($varStack[‘GLOBALS’] as $key => $value) {
$GLOBALS[$key] = $value;
}

This is tracked in this Issue here

and the PR to fix it is this one