Hallo,
hatte dasselbe Problem auf einem Windows Server. Dort funktioniert es nur, wenn die URL auf der Typo3 installiert ist, absolut ist, also ohne Anhang.
Ist Typo3 auf einer relativen Domain Installiert gibt es 2 Lösungen, beide haben Vor- und Nachteile.
Lösung 1: Globale Installation
Im Install Tool "AllowGlobalInstall" auf 1, dann phpmyadmin global installieren. Sollte funktionieren, egal, wie die Domain lautet.
Lösung 2 "komplizierte Notlösung" (falls globale Installation nicht machbar):
Dazu muss man im phpmyadmin Extension Verzeichnis unter "modsub/index.php" die folgenden Zeilen verändern (hier der komplette Auszug der index.php):
<?php
/***************************************************************
* Copyright notice
*
* (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
* (c) 2006-2010 mehrwert (typo3@mehrwert.de)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Utilities for the phpMyAdmin third party database administration Tool
*
* @package TYPO3
* @subpackage tx_phpmyadmin
* @version $Id: index.php 36157 2010-07-29 16:11:29Z mehrwert $
* @author mehrwert <typo3@mehrwert.de>
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
* @license GPL
*/
class SC_mod_tools_phpadmin_index {
/**
* Configuration for the module
* @var Array
*/
var $MCONF = array();
/**
* The backend document
* @var Object
*/
var $doc;
/**
* The main method of the Plugin
*
* @return Mixed Either returns an error or sends a redirect header
*/
public function main() {
// Declare globals
global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
// Set the path to phpMyAdmin
$extPath_old = t3lib_extMgm::extPath('phpmyadmin');
$extPath = "/deineRelativeDomain".t3lib_extMgm::extPath('phpmyadmin');
$typo3DocumentRoot = t3lib_div::getIndpEnv('TYPO3_DOCUMENT_ROOT');
// Set class config for module
$this->MCONF = $GLOBALS['MCONF'];
// Get config
$extensionConfiguration = unserialize($TYPO3_CONF_VARS['EXT']['extConf']['phpmyadmin']);
// Path to install dir
$this->MCONF['PMA_absolute_path'] = $extPath.$this->MCONF['PMA_subdir'];
// echo $this->MCONF['PMA_absolute_path'];
// = $extPath.$this->MCONF['PMA_subdir'];
// Path to web dir
$this->MCONF['PMA_relative_path'] = t3lib_extMgm::extRelPath('phpmyadmin').$this->MCONF['PMA_subdir'];
// If phpMyAdmin is configured in the conf.php script, we continue to load it...
if ($this->MCONF['PMA_absolute_path']) {
// && @is_dir($this->MCONF['PMA_absolute_path'])) {
// echo "TEST";
// Need to have cookie visible from parent directory
session_set_cookie_params(0, '/', '', 0);
// Create signon session
$session_name = 'tx_phpmyadmin';
session_name($session_name);
session_start();
// Store there credentials in the session
$_SESSION['PMA_single_signon_user'] = TYPO3_db_username;
$_SESSION['PMA_single_signon_password'] = TYPO3_db_password;
$_SESSION['PMA_single_signon_host'] = TYPO3_db_host;
$_SESSION['PMA_single_signon_only_db'] = TYPO3_db;
// Configure some other parameters
$_SESSION['PMA_extConf'] = $TYPO3_CONF_VARS['EXT']['extConf']['phpmyadmin'];
$_SESSION['PMA_hideOtherDBs'] = $extensionConfiguration['hideOtherDBs'];
// Get signon uri for redirect
// Hier den Zähler auf +1
$path_ext = substr($extPath, strlen($typo3DocumentRoot)+1, strlen($extPath));
$path_ext = (substr($path_ext, 0, 1) != '/' ? '/'.$path_ext : $path_ext);
$path_pma = $path_ext.$this->MCONF['PMA_subdir'];
$_SESSION['PMA_SignonURL'] = $path_pma.'index.php';
// Try to get the TYPO3 backend uri even if it's installed in a subdirectory
// Compile logout path and add a slash if the returned string does not start with
$path_typo3 = substr(PATH_typo3, strlen($typo3DocumentRoot), strlen(PATH_typo3));
// $path_typo3 = (substr($path_typo3, 0, 1) != '/' ? '/'.$path_typo3 : $path_typo3);
$_SESSION['PMA_LogoutURL'] = $path_typo3.'logout.php';
// Prepend document root if uploadDir does not start with a slash "/"
$extensionConfiguration['uploadDir'] = trim($extensionConfiguration['uploadDir']);
if (strpos($extensionConfiguration['uploadDir'], '/') !== 0) {
$_SESSION['PMA_uploadDir'] = $typo3DocumentRoot.'/'.$extensionConfiguration['uploadDir'];
} else {
$_SESSION['PMA_uploadDir'] = $extensionConfiguration['uploadDir'];
}
$_SESSION['PMA_typo_db'] = TYPO3_db;
$id = session_id();
// Force to set the cookie according to issue #8884
// http://bugs.typo3.org/view.php?id=8884#c23323
setcookie($session_name, $id, 0, '/', '');
// Close that session
session_write_close();
// Mapping language keys for phpMyAdmin
$LANG_KEY_MAP = array(
'dk'=>'da',
'de'=>'de',
'no'=>'no',
'it'=>'it',
'fr'=>'fr',
'es'=>'es',
'nl'=>'nl',
'cz'=>'cs-iso',
'pl'=>'pl',
'si'=>'sk'
);
$LANG_KEY = $LANG_KEY_MAP[$LANG->lang];
if (!$LANG_KEY) {
$LANG_KEY = 'en';
}
// Redirect to phpMyAdmin (should use absolute URL here!), setting default database
$redirect_uri = $_SESSION['PMA_SignonURL'].'?lang='.$LANG_KEY.'&db='.urlencode(TYPO3_db);
// Build and set cache-header header
$headers = array(
'Expires: Mon, 26 Jul 1997 05:00:00 GMT',
'Pragma: no-cache',
'Cache-Control: private',
'Location: '.$redirect_uri
);
// Send all headers
foreach($headers as $header) {
header($header);
}
} else {
// No configuration set
$this->doc = t3lib_div::makeInstance('mediumDoc');
$this->doc->backPath = $BACK_PATH;
$this->content = $this->doc->startPage($LANG->getLL('title'));
$this->content .= ('
<h3>phpMyAdmin module was not installed?</h3>
'.($this->MCONF['PMA_subdir'] && !@is_dir($this->MCONF['PMA_subdir'])?'<hr /><strong>ERROR: The directory, '.$this->MCONF['PMA_subdir'].', was NOT found!</strong><HR>':'').'
');
$this->content .= $this->doc->endPage();
}
}
/**
* Prints the content of the module directly to the browser
*
* @return void
*/
public function printContent() {
echo $this->content;
}
}
// Proceed if BE loaded
if (in_array('t3lib_div', get_declared_classes())) {
// Apply access restrictions
$BE_USER->modAccess($MCONF, 1);
// Make instance:
$SOBE = t3lib_div::makeInstance('SC_mod_tools_phpadmin_index');
$SOBE->main();
$SOBE->printContent();
} else {
echo '<h1>Error</h1><p>The TYPO3 Backend is required for phpMyAdmin module but was not loaded.</p>';
}
?>