Strona 1 z 1
Problem z przeniesieniem forum na inny serwer
: 23 maja 2005, 19:04
autor: Solo
Mam nastepujacy problem: skopiowalem i przenioslem zawartosc bazy danych na nowy serwer, dokonalem odpowiednich zmian polau bazy odnoszacym sie do adresu serwera, skopiowalem pliki forum na nowy serwer i dokonalem odpowiednch zmian w config.php i po probie uruchomienia forum otrzymuje takie komunikaty bledow:
Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/ofilmie/public_html/forum/db/mysql4.php on line 330
Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /home/ofilmie/public_html/forum/db/mysql4.php on line 331
phpBB : Critical Error
Could not connect to the database
Bardzo prosze o pomoc, jesli ktos ma jakis pomysl co moglem zrobic zle.
: 24 maja 2005, 19:22
autor: danger_riff
Oj raczej nie pozmieniałeś ( lub pozmieniałeś tylko część ) komurek w tabeli phpbb_config. Musisz zmienić wpisy w komurkach server_name, script_path. Sprubuj także tego skryptu:
Kod: Zaznacz cały
<?php
/***************************************************************************
* config_gen.php
* -------------------
* begin : 20.08.02 13.45
* copyright : (C) 2002 Dimitri Seitz
* email : dwing@weingarten-net.de
*
* Tlumaczenie : Patt <patt@post.pl>
* Strona www: : http://www.patt.page.iserwer.pl
*
***************************************************************************/
/***************************************************************************
*
* 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.
*
***************************************************************************/
/***************************
*
* Configuration Start
*
*
****************************/
$default_template = 'subSilver';
$available_dbms = array("mysql", "mysql4", "postgres", "mssql" , "msaccess" , "mssql-odbc");
/***************************
*
* Configuration End
*
*
****************************/
if (!isset($HTTP_POST_VARS['submit']))
{
?>
<form method="POST" action="<?php echo $PHP_SELF ?>">
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tbody>
<tr>
<td>
<table cellSpacing="0" cellPadding="0" width="100%" border="0">
<tbody>
<tr>
<td><img alt="phpBB2 :: configGen"
src="templates/<?php echo $default_template ?>/images/logo_phpBB.gif" vspace="1" border="0"></td>
<td vAlign="center" align="middle" width="100%"></td>
</tr>
</tbody>
</table>
<br>
<table cellSpacing="0" cellPadding="10" width="100%" align="center" border="0">
<tbody>
<tr>
<td vAlign="center" align="middle" width="100%"></td>
</tr>
<tr>
<td width="100%">
<div align="center">
<center>
<table class="forumline" cellSpacing="1" cellPadding="2" width="80%" border="0" bgcolor="#333333">
<tbody>
<tr>
<th colSpan="2" width="80%"><font color="#C0C0C0">Konfiguracja Bazy</font></th>
</tr>
<tr>
<td class="row1" align="right" width="80%" bgcolor="#C0C0C0"><span class="gen">Server Bazy Danych / DSN:</span></td>
<td class="row2" width="80%" bgcolor="#C0C0C0"><input name="dbhost" size="20"></td>
</tr>
<tr>
<td class="row1" align="right" width="80%" bgcolor="#808080"><span class="gen">Nazwa Bazy Danych:</span></td>
<td class="row2" width="80%" bgcolor="#808080"><input name="dbname" size="20"></td>
</tr>
<tr>
<td class="row1" align="right" width="80%" bgcolor="#C0C0C0"><span class="gen">Login do Bazy Danych:</span></td>
<td class="row2" width="80%" bgcolor="#C0C0C0"><input name="dbuser" size="20"></td>
</tr>
<tr>
<td class="row1" align="right" width="80%" bgcolor="#808080"><span class="gen">Haslo do Bazy Danych:</span></td>
<td class="row2" width="80%" bgcolor="#808080"><input type="password" value name="dbpasswd"
size="20"></td>
</tr>
<tr>
<td class="row1" align="right" width="80%" bgcolor="#C0C0C0"><span class="gen">Wybierz prefix:</span></td>
<td class="row2" width="80%" bgcolor="#C0C0C0"><input name="table_prefix" size="20"></td>
</tr>
<tr>
<td class="row1" align="right" width="80%" bgcolor="#808080">Typ Bazy Danych:</td>
<td class="row2" width="80%" bgcolor="#808080"><select size="1" name="dbms">
<option selected>Wybierz typ Bazy Danych</option>
<?php
foreach($available_dbms as $types)
{
echo "<option value=\"$types\">$types</option>\n";
}
?>
</select></td>
</tr>
<tr>
<td class="catbottom" align="middle" colSpan="2" width="80%">
<p align="center"><input class="mainoption" type="submit" value="Submit" name="submit"></p>
</td>
</tr>
</FORM>
</tbody>
</table>
</center>
</div>
<br>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p> </p>
</form>
<?php
die('Prosze wprowadzic wszystkie dane.<br />');
}
else
{
echo '<img alt="phpBB2 :: configGen"
src="templates/' . $default_template . '/images/logo_phpBB.gif" vspace="1" border="0"></td>
<td vAlign="center" align="middle" width="100%"><br />';
define('IN_PHPBB',1);
require_once('extension.inc');
if( !(file_exists("config.$phpEx")))
{
$fp = @fopen("config.$phpEx", "a");
}
else
{
echo 'Kasowanie starego config.php<br />';
$fp = @fopen("config.$phpEx", "w+");
}
$time = time();
if(!@fwrite($fp,
'<?php
//
// phpBB 2.0.x auto-generated config file
// Do not change anything in this file!
//
$dbms = \''. $dbms . '\';
$dbhost = \''. $dbhost . '\';
$dbname = \''. $dbname . '\';
$dbuser = \''. $dbuser . '\';
$dbpasswd = \''. $dbpasswd . '\';
$table_prefix = \''. $table_prefix . '\';
define(\'PHPBB_INSTALLED\', true);
define(\'INSTALL_DATE\', '. $time . ');
//
// Generated with configGen (c) Dwing
// More Hacks and Mods ?
// http://www.phpbbhacks.com
// http://www.dseitz.de
//
?>'))
{
echo 'Twoj serwer nie pozwala na nadpisanie pliku<br />Stworz plik nazwany config.' . $phpEx . ' i umiesc go tu: <br /><textarea rows="30" name="config.php" cols="50"><?php
//
// phpBB 2.0.x auto-generated config file
// Do not change anything in this file!
//
$dbms = \''. $dbms . '\';
$dbhost = \''. $dbhost . '\';
$dbname = \''. $dbname . '\';
$dbuser = \''. $dbuser . '\';
$dbpasswd = \''. $dbpasswd . '\';
$table_prefix = \''. $table_prefix . '\';
define(\'PHPBB_INSTALLED\', true);
define(\'INSTALL_DATE\', '. $time . ');
//
// Generated with configGen (c) Dwing
// More Hacks and Mods ?
// http://www.phpbbhacks.com
// http://www.dseitz.de
//
?></textarea>';
}
die('<br />Koniec<br />');
}
?>
wklej go do pliku np. cos_tam.php i skopiuj do gl. katalogu z Twoim forum i odpal. Bardzo przydatny programik przy przenoszeniu forum.
: 24 maja 2005, 20:57
autor: Solo
Sek w tym, ze zmienilem adres serwera i sciezke dostepu do forum w komorce phpbb_config. Zreszta blad wyraznie mowi, ze nie moze sie polaczyc z baza danych, a wiec nawet gdybym te dane zle wprowadzil, to i tak by ich nie odczytal....
: 25 maja 2005, 18:21
autor: danger_riff
No tak, czyli wniosek jest prosty: albo podales niewlasciwe haslo bazy, albo zla nazwe uzytkownika, albo zly adres serwera bazy danych.
: 25 maja 2005, 23:40
autor: Solo
Na 100% podalem wlasciwe dane w pliku config.php - sprawdzalem to juz wiele razy.
Tak samo z phpbb_config tez jest adres serwera podany....
Tzn - adres strony, na ktorej jest forum to
http://www.ofilmie.pl/forum .
Czy w takim razie dobry podalem adres w tej komorce bazy -
http://www.ofilmie.pl ?