Creating a new config.php
Article ID: 57
Written By: will_hough
Written On: Mon May 14, 2007 3:57 pm
Description: I deleted my config.php file. What do I do? This article will help you create a new one.
- Link to this article: Select All
[url=http://www.phpbb.com/kb/article/creating-a-new-configphp/]Knowledge Base - Creating a new config.php[/url]
dbinformer- It is now possible to regenerate the config.php file through dbinformer.php, located in the contrib/ directory. Since this is not an "official" script, support is not offered. Also, since phpBB now requires you to delete this directory before the board will work (you will receive an error otherwise), it may not be there. If it isn't, don't fret. You can download it in the phpBB2 full download or just keep reading. Otherwise, enter all information dbinformer asks for, and check the box "Generate a config file." That's it - hit submit, and copy and paste the code dbinformer gives you into a new config.php.
Manually Creating New File- So you accidentally deleted your config.php file and don't have a backup?
- Don't worry, You can create a new one!
- Start by making a new folder on your local hard drive and name it my_site.
- Open that folder and (in windows) right click, select 'New' then 'Text Document'
- Open the new document and paste this code into it.
- Code: Select all
<?php
$dbms = 'mysql';
$dbhost = 'localhost';
$dbname = 'database_name';
$dbuser = 'database_username';
$dbpasswd = 'database_password';
$table_prefix = 'phpbb_';
define('PHPBB_INSTALLED', true);
?>
All of the database information was set by you when you created your database. - $dbms
The first line we need to edit is the database version that you are using. It is currently set to 'mysql'. Remember that the database type is case-sensitive and spelling-sensitive.
Database options:
- MySQL 3.x = 'mysql'
- MySQL 4.x and MySQL 5.x = 'mysql4'
- postgres = 'postgres7'
- MSSQL = 'mssql'
- MSSQL ODBC = 'mssql-odbc'
- oracle = 'oracle'
- msaccess = 'msaccess'
- $dbhost
The second line is your database host. If you have a folder inside the root of your hosting account named phpMyAdmin then you are probably running it locally, so you can leave it how it is because you are running your database on a 'localhost'.
If you are not running a local database you will need to find out your host. i.e. "server.database.com" - $dbname
Third line is the name of your database. Not to be confused with the database username. - $dbuser
The fourth line is the database user name. This is the user name assigned to access the database. - $dbpasswd
The fifth and final line to edit is the database password, used to access your database. - $table_prefix
This is the prefix of the table names in your database. The default table prefix in phpBB2.x is phpbb_ - define
This states that phpBB is installed 'true' and will not redirect to an install. - Now save the text file as 'config.php' being sure to set the Save As File Type in your editor to All Files or enclose the filename in quotes.
- Now upload this to the root of your board, place it in the same directory with 'index.php' and 'common.php'
- Take this opportunity to create a backup of your entire board. You will thank yourself for it later.