Bug #58337
closed'Clear all cache' redirects to 'Detected Fatal Error' with 'No database selected'
100%
Description
Detected Fatal Error Uncaught exception 'RuntimeException' with message 'TYPO3 Fatal Error: No database selected!' in /xxxx/typo3_src-test/typo3/sysext/core/Classes/Database/DatabaseConnection.php:1563 Stack trace: #0 /xxxx/typo3_src-test/typo3/sysext/install/Classes/Service/ClearCacheService.php(116): TYPO3\CMS\Core\Database\DatabaseConnection->connectDB() #1 /xxxx/typo3_src-test/typo3/sysext/install/Classes/Service/ClearCacheService.php(67): TYPO3\CMS\Install\Service\ClearCacheService->getDatabaseConnection() #2 /xxxx/typo3_src-test/typo3/sysext/install/Classes/Controller/Action/Tool/ImportantActions.php(162): TYPO3\CMS\Install\Service\ClearCacheService->clearAll() #3 /xxxx/typo3_src-test/typo3/sysext/install/Classes/Controller/Action/Tool/ImportantActions.php(57): TYPO3\CMS\Install\Controller\Action\Tool\ImportantActions->clearAllCache() #4 /xxxx/typo3_src-test/typo3/sysext/install/Classes/C in /xxxx/typo3_src-test/typo3/sysext/core/Classes/Database/DatabaseConnection.php on line 1563
New T3 6.2.1 installation. Core symlinked.
After moving the database settings from LocalConfiguration.php to an external file and include this in AdditionalConfiguration.php the error comes up.
The Install Tool shows the right database parameter and the backend worked.
But 'Clear all caches' in the Install Tool throws the error.
AdditionalConfiguration.php:
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } $configFile = PATH_site . '../../config/T3Configuration.php'; if (file_exists($configFile)) { require_once($configFile); } ?>
T3Configuration.php:
<?php if (!defined('TYPO3_MODE')) { die('Access denied.'); } $GLOBALS['TYPO3_CONF_VARS']['DB']['database'] = 'xxxx'; $GLOBALS['TYPO3_CONF_VARS']['DB']['password'] = 'xxxx'; $GLOBALS['TYPO3_CONF_VARS']['DB']['host'] = '127.0.0.1'; $GLOBALS['TYPO3_CONF_VARS']['DB']['port'] = 3306; $GLOBALS['TYPO3_CONF_VARS']['DB']['username'] = 'xxxx'; ?>
Updated by Oliver Hader over 10 years ago
- Status changed from New to Accepted
- Priority changed from Must have to Should have
- Target version deleted (
next-patchlevel)
Updated by Gerrit Code Review over 10 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29811
Updated by Helmut Hummel over 10 years ago
Gerrit Mohrmann wrote:
AdditionalConfiguration.php:
[...]
require_once of T3Configuration.php is wrong. It must be just plain require here!
What are the reasons not to use just "require" ?
Updated by Helmut Hummel over 10 years ago
- Status changed from Under Review to Needs Feedback
Updated by Gerrit Code Review over 10 years ago
- Status changed from Needs Feedback to Under Review
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29811
Updated by Gerrit Code Review over 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29811
Updated by Sascha Wilking over 10 years ago
Correct, it recommend to use require instead of require_once. But it don't make sense to reload LocalConfiguration and AdditionalConfiguration in the clear all cache method.
Updated by Gerrit Code Review over 10 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29811
Updated by Gerrit Code Review over 10 years ago
Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29811
Updated by Gerrit Code Review over 10 years ago
Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/29811
Updated by Sascha Wilking over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 9c56789817f94179ecc10fcc960591f999abb2d8.
Updated by Gerrit Mohrmann over 10 years ago
Helmut Hummel wrote:
What are the reasons not to use just "require" ?
No reason for the require_once, require does it. Thanks!