Seite 1 von 1

mod_rewrite

Verfasst: 05.06.2005 23:12
von eduard1990
bei der installation von mod_rewrite kan dieser Fehler woran kann es liegen?

Fatal error: Cannot redeclare replace_for_mod_rewrite() (previously declared in /srv/www/htdocs/web249/html/includes/page_header.php:75) in /srv/www/htdocs/web249/html/includes/page_header.php on line 154

Verfasst: 05.06.2005 23:17
von rabbit
prüfe nochmal deine page_tail.php auf richtigkeit bzgl. des einbaus.

Verfasst: 05.06.2005 23:18
von eduard1990
kenn mich nicht gut mit php aus ist da was falsch??



<?php
/***************************************************************************
* page_tail.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : support@phpbb.com
*
* $Id: page_tail.php,v 1.27.2.3 2004/12/22 02:04:00 psotfx Exp $
*
*
***************************************************************************/

/***************************************************************************
*
* This program 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.
*
***************************************************************************/

if ( !defined('IN_PHPBB') )
{
die('Hacking attempt');
}

//
// Show the overall footer.
//
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';

$template->set_filenames(array(
'overall_footer' => ( empty($gen_simple_header) ) ? 'overall_footer.tpl' : 'simple_footer.tpl')
);

$template->assign_vars(array(
'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '',
'ADMIN_LINK' => $admin_link)
);

$template->pparse('overall_footer');

//
// Close our DB connection.
//
$db->sql_close();
//
// Short URL implementation
//
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
//
// Short URL implementation
//
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);

//
// Compress buffered output if required and send to browser
//
if ( $do_gzip_compress )
{
//
// Borrowed from php.net!
//
$gzip_contents = ob_get_contents();
//
// Short URL implementation
//
$gzip_contents = replace_for_mod_rewrite($gzip_contents);
//
// Short URL implementation
//
$gzip_contents = replace_for_mod_rewrite($gzip_contents);
ob_end_clean();

$gzip_size = strlen($gzip_contents);
$gzip_crc = crc32($gzip_contents);

$gzip_contents = gzcompress($gzip_contents, 9);
$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);

echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
echo $gzip_contents;
echo pack('V', $gzip_crc);
echo pack('V', $gzip_size);
}

exit;

?>

Verfasst: 05.06.2005 23:25
von rabbit
du hast beides doppelt reingesetzt:

Code: Alles auswählen

// 
// Short URL implementation 
// 
$contents = ob_get_contents(); 
ob_end_clean(); 
echo replace_for_mod_rewrite($contents); 
und

Code: Alles auswählen

// 
// Short URL implementation 
// 
$gzip_contents = replace_for_mod_rewrite($gzip_contents); 
nimm je einen der beiden doppelten codes wieder raus. ;)

*edit*
und bitte keine kompletten dateien hier reinstellen, besser als .txt-datei hier verlinken.
siehe auch KB:datei :)

Verfasst: 05.06.2005 23:29
von eduard1990
es hat sich leider nichts geändert vielleicht habe ich wieder etwas faslch gemacht

Code: Alles auswählen

<?php
/***************************************************************************
 *                              page_tail.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: page_tail.php,v 1.27.2.3 2004/12/22 02:04:00 psotfx Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program 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.
 *
 ***************************************************************************/

if ( !defined('IN_PHPBB') )
{
	die('Hacking attempt');
}

//
// Show the overall footer.
//
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '';

$template->set_filenames(array(
	'overall_footer' => ( empty($gen_simple_header) ) ? 'overall_footer.tpl' : 'simple_footer.tpl')
);

$template->assign_vars(array(
	'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '',
	'ADMIN_LINK' => $admin_link)
);

$template->pparse('overall_footer');

//
// Close our DB connection.
//
$db->sql_close();
//
// Short URL implementation
//
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
//
// Short URL implementation
//
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);

//
// Compress buffered output if required and send to browser
//
if ( $do_gzip_compress )
{
	//
	// Borrowed from php.net!
	//
	$gzip_contents = ob_get_contents();
	$gzip_contents = replace_for_mod_rewrite($gzip_contents);
	   //
   // Short URL implementation
   //
   $gzip_contents = replace_for_mod_rewrite($gzip_contents);
	ob_end_clean();

	$gzip_size = strlen($gzip_contents);
	$gzip_crc = crc32($gzip_contents);

	$gzip_contents = gzcompress($gzip_contents, 9);
	$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);

	echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
	echo $gzip_contents;
	echo pack('V', $gzip_crc);
	echo pack('V', $gzip_size);
}

exit;

?>

Verfasst: 05.06.2005 23:37
von eduard1990
Kannst du mir vielleicht einen ganzen fertigen code für den page_tail und page_header geben?

Verfasst: 05.06.2005 23:40
von rabbit
du hast nicht getan, was ich dir gesagt hatte... :roll:

nimm' die hier mal:

Code: Alles auswählen

<?php 
/*************************************************************************** 
 *                              page_tail.php 
 *                            ------------------- 
 *   begin                : Saturday, Feb 13, 2001 
 *   copyright            : (C) 2001 The phpBB Group 
 *   email                : support@phpbb.com 
 * 
 *   $Id: page_tail.php,v 1.27.2.3 2004/12/22 02:04:00 psotfx Exp $ 
 * 
 * 
 ***************************************************************************/ 

/*************************************************************************** 
 * 
 *   This program 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. 
 * 
 ***************************************************************************/ 

if ( !defined('IN_PHPBB') ) 
{ 
   die('Hacking attempt'); 
} 

// 
// Show the overall footer. 
// 
$admin_link = ( $userdata['user_level'] == ADMIN ) ? '<a href="admin/index.' . $phpEx . '?sid=' . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : ''; 

$template->set_filenames(array( 
   'overall_footer' => ( empty($gen_simple_header) ) ? 'overall_footer.tpl' : 'simple_footer.tpl') 
); 

$template->assign_vars(array( 
   'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '', 
   'ADMIN_LINK' => $admin_link) 
); 

$template->pparse('overall_footer'); 

// 
// Close our DB connection. 
// 
$db->sql_close(); 

// 
// Short URL implementation 
// 
$contents = ob_get_contents(); 
ob_end_clean(); 
echo replace_for_mod_rewrite($contents); 

// 
// Compress buffered output if required and send to browser 
// 
if ( $do_gzip_compress ) 
{ 
   // 
   // Borrowed from php.net! 
   // 
   $gzip_contents = ob_get_contents(); 
    
   // 
   // Short URL implementation 
   // 
   $gzip_contents = replace_for_mod_rewrite($gzip_contents); 
   ob_end_clean(); 

   $gzip_size = strlen($gzip_contents); 
   $gzip_crc = crc32($gzip_contents); 

   $gzip_contents = gzcompress($gzip_contents, 9); 
   $gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4); 

   echo "\x1f\x8b\x08\x00\x00\x00\x00\x00"; 
   echo $gzip_contents; 
   echo pack('V', $gzip_crc); 
   echo pack('V', $gzip_size); 
} 

exit; 

?>
sorry, dass ich jetzt auch schon mit dem code anfange...

Verfasst: 05.06.2005 23:46
von eduard1990
also es geht immer noch nicht siehe signatur

Verfasst: 05.06.2005 23:52
von eduard1990
ich mache es wieder so wie es war hab ja morgen sowieso einen anderen hoster

Verfasst: 06.06.2005 13:43
von S2B
Du könntest evtl. auch mal suchen :roll:
http://www.phpbb.de/viewtopic.php?t=88518

Edit: Mist, hab mich verlesen, vergiss, was ich gesagt habe *duck*