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
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.
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”
[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
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
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;
}
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;
}