[問題] 關於上傳檔案
發表於 : 2005-06-15 13:46
如果我是傳檔到自有的FTP空間是否也有
php 組態只允許 2MB 的最大上傳限制的設定問題
因為我傳檔超過3mb就會出現\r
Tried to upload empty file
錯誤訊息
php 組態只允許 2MB 的最大上傳限制的設定問題
因為我傳檔超過3mb就會出現\r
Tried to upload empty file
錯誤訊息
I've found several solutions for restoring large DBs, but none as simple as this "emergency hack". As long as you have FTP access to the forum, you can probably use this method.
Using the FTP client of your choice, upload your backup.sql file to phpBB/admin/, where backup.sql is the name of your backup file and phpBB is the name of your forum root directory.
It could probably take a while to upload, so go get a cup of coffee or check your email... or something.
When the file is finished uploading, you need to modify ONE phpBB file. Notice phpBB/admin/admin_db_utilities.php is in THE SAME directory that you just uploaded your backup.sql.
In phpBB/admin/admin_db_utilities.php find the code snippet:
Code:
else
{
$sql_query = fread(fopen($backup_file_tmpname, 'r'), filesize($backup_file_tmpname));
}
Now we can force phpBB to read our file by replacing the above code with this code ("backup.sql" is the name of your backup file, and the quotes are required):
Code:
else
{
$sql_query = fread(fopen("backup.sql",'r'), filesize("backup.sql"));
}
Go into your phpBB Admin Control panel, click the Restore Database link.
Type anything you want into the textbox, but don't leave it empty.Click the Start Restore button and your Database will start restoring immediately (no more uploading required). It may take a couple minutes for the process to finish, so go get another cup of coffee. When you get back, it *should* tell you that the DB was properly restored.
Just for security, restore your phpBB/admin/admin_db_utilities.php file to its original state and delete the phpBB/admin/backup.sql file. This will prevent "accidental" restoration (there are no safeguards in place for this method/hack)