[TYPO3-german] Keine Datenbankverbindung nach Typo3 V 6.0 Installation

Thomas Bügel thomas.buegel at web.de
Thu Jan 17 14:22:20 CET 2013


WAMP Testsystem: Apache 2.2, PHP 5.3.9, MySQL 5.1.26
Zugriff mit User/Passwort-Daten in anderen Systemen getestet => OK

Die Original-Installation liefert erstmal während der Installation nur 
die Meldung:

[### FEHLER-MELDUNG
ThreadStackSize
... On Windows the default stack size for Apache is a lot smaller than 
on unix. You can increase the size to 8MB (default on unix) by adding to 
the httpd.conf:
<IfModule mpm_winnt_module>
ThreadStackSize 8388608
</IfModule>
...
###]

Den IfModule-Block habe ich eingefügt, die Meldung kommt trotzdem! Dann 
noch:

[### FEHLER-MELDUNG
Check database:
Could not connect to SQL database!
Connecting to SQL database failed with these settings:
Username: ******
Host: localhost
...
###]

Nach Einstellung aller DEBUG-Parameter auf [ON] in All Configuration / 
LocalConfiguration.php  und Deaktivierung der vorgelagerten Abfrage des 
Parameters $db kommt im Backend die Uncaught TYPO3 Exception:

[### FEHLER-MELDUNG
#1270853884: TYPO3 Fatal Error: The current , password or host was not 
accepted when the connection to the database was attempted to be 
established!
RuntimeException thrown in file
...typo3\sysext\core\Classes\Database\DatabaseConnection.php in line 1279.
###]

Dies weist daraufhin, dass $this->sql_pconnect([args]) false zurückliefert

in typo3\sysext\core\Classes\Database\DatabaseConnection.php in Zeile 
ca. 1265
[### PHP-CODE
public function connectDB($host = TYPO3_db_host, $user = 
TYPO3_db_username, $password = TYPO3_db_password, $db = TYPO3_db) {
		...
     /* Auskommentiert um zu sehen, ob pconnect überhaupt funktioniert
     if (!$db) {
			throw new \RuntimeException('TYPO3 Fatal Error: No database selected! 
=> SQL-Error: '.$GLOBALS['TYPO3_DB']->sql_error(), 1270853882);
		}
		*/
		// Hier Aufruf von sql_pconnect([args]) sh. unten
		if ($this->sql_pconnect($host, $user, $password)) {
			if (!$this->sql_select_db($db)) {
				throw new \RuntimeException('TYPO3 Fatal Error: Cannot connect to 
the current database, "' . $db . '"!', 1270853883);
			}
		} else {
			throw new \RuntimeException('TYPO3 Fatal Error: The current , 
password or host was not accepted when the connection to the database 
was attempted to be established!', 1270853884);
		}
		...
###]

Nun habe ich  in die Funktion sql_pconnect zwei Zeilen eingefügt, 
wodurch direkt nach Aufruf dieser Funktion ein Runtime-Fehler geworfen 
werden müsste, der die übergebenen Parameter ausgeben und das Script an 
dieser Stelle beenden müsste.

in typo3\sysext\core\Classes\Database\DatabaseConnection.php in Zeile 
ca. 1040
[### PHP-CODE
public function sql_pconnect($TYPO3_db_host, $TYPO3_db_username, 
$TYPO3_db_password) {
		// mysql_error() is tied to an established connection
		// if the connection fails we need a different method to get the error 
message
		@ini_set('track_errors', 1);
		@ini_set('html_errors', 0);
		//DEBUG
		$message = 'pconnect-Start: TYPO3_db_host: '.$TYPO3_db_host.', 
TYPO3_db_username: '.$TYPO3_db_username.', TYPO3_db_password: 
'.$TYPO3_db_password;
		throw new \RuntimeException($message, 0000000000);
		...
###]

Macht es aber nicht. Es wird der Runtime-Fehler aus der Funktion 
connectDB geworfen, wie wenn sql_pconnect false zurückliefern würde, 
doch sql_pconnect wird anscheinend gar nicht aufgerufen, sonst würde ja 
deren Fehler-Meldung, die ich eingefügt habe zuerst ausgegeben und das 
Script danach beendet.

Hab die Aufrufe in aktuellen Firefox und Chrome getestet!

Sorry hab keine Idee mehr, was ich noch probieren könnte. Hat da jemand 
eine Idee?

Grüße
Tom


More information about the TYPO3-german mailing list