Installing phpBB
From InstallationWiki
| Official Page |
| Project Documentation |
| Download |
|
The installation process is generally not hard. phpBB has a built-in browser-based installer that makes the job much easier but there are some pre-requisites and some details you need to be aware of before you begin.
Pre-Installation
In this section you'll find out about the phpBB server requirements, which are on the lower end (price-wise) of the server configurations offered by hosting providers. Then the section discusses some database-related topics and ends with a checklist you can use to make sure you have everything you need to start the installation process.
[edit] Requirements
phpBB is very flexible in terms of server requirements, and you have a lot of options. But let's concentrate on the configuration that is most widely used, consisting of:
- Any major operating system.
- Apache web server.
- MySQL database system, version 3.22 or higher.
- PHP version 4; PHP3 will also do, but it's recommended that you use the latest stable version.
phpBB was designed with portability in mind, so all of the requirements listed above are very flexible. Let's look at them in more detail and also see what options you have.
- The operating system (OS): phpBB is OS independent. That means it can run on all sorts of operating systems Windows, Linux, MacOS. You should not have any problem meeting this requirement and can enjoy running your forums in your preferred or most affordable environment.
- The web server: phpBB can run on various web servers, including the most popular Apache server and Microsoft's Internet Information Systems (IIS). If you're using a hosting service, the web server requirement won't be in the way. But if you want to install phpBB on your computer, you'll have to take care of this detail. Although describing how to install a web server is not within the scope of this tutorial, you'll find some useful information further down.
- The database system: Currently supported by phpBB are MySQL 3.22 or higher (including MySQL 4.x), PostgreSQL 7.0.3, MS SQL Server (7 or 2000, directly or via ODBC), and MS Access (2000 or XP) via ODBC. Again, depending if you're installing phpBB locally or on a remote server, you'll need to either install a supported database system on your computer, or simply ask you service provider what database you have access to.
- PHP: In general, all PHP applications consist of files containing programming instructions that are executed by what is called a PHP interpreter. The PHP interpreter is a piece of software that you'll need to have running on the system where you want to install phpBB. If you go with a hosting service, the good news is that PHP is so popular that it would be actually harder to find a host that doesn't support it. PHP 4.x is the most widely used PHP version and also the most widely used for phpBB installations. As already mentioned, PHP 3.x will be sufficient to have your board running, but it's not recommended. PHP 5 is also not recommended (yet), because phpBB is not thoroughly tested on this platform, due to the fact that phpBB was developed prior to the release of PHP 5.
[edit] The Attack Plan
Now that you're clear on the requirements, let's explore the options for the system to install phpBB to:
- You have an existing web hosting service: In this case all you need to do is contact your hosting provider and ask them if they support PHP and any of the databases listed above, preferably MySQL. If they don't, find out if they can install/enable these for you. If they still can't help you, you'll need to pick one of the remaining options.
- You're shopping around for a good hosting provider: The good news is that even the most inexpensive hosting packages often include PHP and MySQL support. There are lots of points to consider when choosing a hosting provider, but at the very least, browse for some independent reviews on the Web. Don't just rush into the cheapest package with huge or even unlimited bandwidth and disk space. Ask your host-to-be a question or two (for example concerning the requirements above) and judge the speed and the quality of their response. You'd want a reliable support when in need.
- You want to install phpBB on your own computer: Sometimes, even if you go with one of the first two options, you might still want to test your board locally. For example, if later on you want to experiment with installing or creating new styles or modifications, it would probably be easier (and definitely safer) to develop and test on your own computer before going live.
If you want to set up the environment on your computer, you have two options: to install all the necessary components one by one, configure them, and make them work together, or to use one of the all-in-one installations (bundles) you can find on the Internet. They usually include one downloadable installer program that takes care of installing and configuring all you need Apache, PHP, MySQL and often more. Such all-in-one bundles are XAMPP (http://www.apachefriends.org/en/) and others that are listed at HotScripts, for example (http://www.hotscripts.com/PHP/Software_and_Servers /Installation_Kits/).
If you want to set up your environment yourself and not make use of the bundles available out there, here's what you need to do.
[edit] Time For Action Setting Up the Environment on Your Local Computer
- Install the Apache web server. Go to http://httpd.apache.org/download.cgi. Download the latest stable 1.3.x version of the server for your operating system from the mirror closest to you geographically. Install it, and if in doubt, refer to the documentation at http://httpd.apache.org/docs/.doubt, refer to the documentation at http://httpd.apache.org/docs/.
- Install PHP. Download the latest stable 4.3.x. release for your operating system from http://www.php.net/downloads.php. Install, referring to the documentation (http://www.php.net/manual/en/install.php) as necessary..
- Install MySQL. Download the latest recommended version from http://dev.mysql.com/downloads/. The documentation is just a click away at http://dev.mysql.com/doc/mysql/en/Installing.html.
- Install phpMyAdmin (optional). phpMyAdmin is a free and a very popular web application for managing MySQL databases through a simple and intuitive browser interface. You don't need it absolutely, but it can make your life a whole lot easier when it comes to database operations. It requires PHP, but you've already installed it anyway, so you're all set. The latest stable version can be downloaded from http://www.phpmyadmin.net/.
While you were downloading, you've probably noticed the suggestions to download "source" or "binaries". Download the binaries, but if you're really curious about what the behind-the-scenes code looks like, download the source files, play around with them, and try compiling them yourself. This, of course, will require some knowledge in C programming. All this source code is free for use, learning, and modifications. Welcome to the wonderful world of open-source software!
Now with a web server running PHP and MySQL (or another database system), let's take a look at some database preparation work.
[edit] Finishing Pre-Install Touch The Database
phpBB will need access to a database, so you'll have to use an existing database or create a new one. Depending on whether you'll be installing on your local computer or on a remote server, you'll have different options for setting up the database required by phpBB; we'll take a look at those options. If you have a choice, use a new empty database for phpBB; it makes maintenance easier.
[edit] Setting Up the Database for Local Installations
If you're installing phpBB on your personal computer, you should have no restrictions creating a new database to use with phpBB. You can do that by using phpMyAdmin or using the console (the command prompt). With phpMyAdmin, creating a new database is really easy; this is one of the first options you're presented with when you load the application. If you don't have phpMyAdmin installed, you can use the command prompt to create a new database. Let's see how to do it both ways. For the purposes the examples in this chapter, let's say your new database is named "forums".
Time For Action Creating the Forum Database with phpMyAdmin
- Go to your main phpMyAdmin page.
- Enter the text forums into the Create new database field.
- Click the Create button.
What Just Happened
You've created a new database. In the database dropdown that you see in your phpMyAdmin on the left, you will now find a new option the "forums" database that you've just created.
Time For Action Creating the Forum Database Using the Command Prompt
- Access your command prompt. (Windows users, click Start, then Run, and then type cmd).
- In the command prompt (console window), follow the path to where MySQL is installed using cd directory_name to enter a directory (cd as in "change directory") and cd.. to go back (one level up), if you've mistakenly entered a wrong directory.
- Once you are in the directory where MySQL is installed, go to the bin directory, where you'll find several MySQL executables.
- Type mysql uroot p.
This instruction means "connect to MySQL using the username root and ask me for a password". root is the default username when MySQL is installed. If you have created other MySQL user accounts, you can use one of those accounts. This instruction means "connect to MySQL using the username root and ask me for a password". root is the default username when MySQL is installed. If you have created other MySQL user accounts, you can use one of those accounts.
- When prompted to provide a password, hit Enter (Return on Macs). What this means is you give a blank password. Username root with a blank password is the default MySQL account. If you have changed this password, type it in.
- You'll see a welcome message and the mysql prompt if you've successfully connected. Type CREATE DATABASE forums; and hit Enter. Do not forget the semicolon at the end.
- If you want to verify that the database has been created, type SHOW DATABASES; and hit Enter. You should see your newly created database in the list.
- That's it. Type exit, hit Enter and MySQL will politely say Bye to you.
- Type exit again to close your command prompt.
[edit] Setting Up the Database for Remote Installations
In this case the process may vary considerably depending on your specific hosting package and its limitations. Here are some possible scenarios:
- Some hosts give you one database only with a predefined name. Find out what that name is; this is the database you'll be using.
- Some hosts let you create your database(s) with phpMyAdmin installed on their server.
- Some give you a different web interface for creating a database as part of the hosting package's control panel.
- Some can give you shell access to their server. Shell access means you'll be able to use a command prompt and execute instructions (commands) on the remote server. In this case, find out from your hosting provider how to establish a shell connection to your server. After you're connected, repeat the
Note - steps for creating a database using the command prompt as previously described. This time you'll be using the database username and password given to you by your host.In order to establish a shell connection you'll need a program called a shell client. A popular choice is the free PuTTY telnet and SSH client (http://www.chiark.greenend.org.uk/~sgtatham/putty/).
Security tip: If at all possible on your host, create a new MySQL user account, give it only privileges to the new database you've just created and use it for the phpBB installation. This may seem a bit too paranoid, but the reason is that usually hosts give you one username and password only and it's good for everything FTP, MySQL, control panel, and shell access. So the reason behind creating a new MySQL username/password combo is that if it gets revealed for some reason, the villain who has it can do only limited damage. This password is good for one database only and not FTP, shell, or control panel access.
When creating this new database user account, it's a good idea to assign only "select", "insert", "update", and "delete" privileges; the other possible privileges are not needed for the normal functioning of phpBB. The phpBB installation, though, will also require a "create" privilege and some modification installations might need "alter" or "drop" privileges. So the most security-oriented option would be to assign "select", "insert", "update", "delete", and "create" privileges to the new database user, and once the installation is completed, remove the "create" privilege.
The actual process of creating the new database user may vary, depending on your hosting provider's policies. Some might not allow it, some might give you a special interface for it, and some might give you access to phpMyAdmin. Creating a new MySQL user account using phpMyAdmin is pretty straightforward; just click the Users link on the phpMyAdmin main page and then fill out the Add form.
If you're using the command prompt for creating a new user, use the following query:
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE ON forums.* TO 'mysecretusername'@'localhost' IDENTIFIED BY 'mysecretpassword';
In this example, forums is the database name, localhost is the database host name, mysecretusername is the username to be assigned to this database user, and mysecretpassword is the password.
[edit] phpBB Pre-Installation Checklist
You're now ready to install phpBB. But take a minute to answer the following questions before you go on; it's just to double-check that you have everything you need:
- Do I have a web server running?
- Is my web server running PHP?
- Is my web server running MySQL or PostgreSQL or MSSQL or MS Access?
- Do I know my FTP hostname, username, and password? (This step is for remote servers only; see the note after the checklist.)
- What's my username to access the database?
- What host is this database running on? (Ask your hosting provider; it's often localhost or 127.0.0.1. In the case of ODBC, a DSN is needed instead.)
- What is the name of my database (e.g. forums)?
A note about FTP: You'll need an FTP program, also known as an FTP client, in order to transfer files from your computer to a remote server. There are a lot of free/trial FTP programs you can use. Just a simple Google search will yield a lot of results. Generally, using an FTP program is not much different than copying files to different locations on your local computer. The difference is that you need to establish a connection to the remote computer first. In order to do that, you need an FTP hostname, a username and a password, which you probably already have, supplied by your hosting provider.
[edit] Installation
Now that all the prerequisites have been met, let's start the installation process:
- Download: Download the compressed phpBB files from http://www.phpbb.com/downloads.php selecting a compression format that you know how to decompress.
- Decompress: Unzip the files to a selected directory, using your preferred compression utility (WinZip for example). If you're installing locally, unzip to a directory within your web root. The top-level directory of the phpBB directory tree will be called phpBB2.
- FTP: If you're installing locally, skip this step. If you're installing on a remote server, copy the whole phpBB2 directory as-is to the remote server. You can do this easily using an FTP program to connect to your server and transfer the files.
- Select your phpBB root. This step is when you need to make an important decision where on your server you are installing phpBB and how you are naming it. The reason why this is important is because this will determine
how your users will see your board. Let's say your domain is http://www.yourdomain.com. You have the following options:
- If you copy the phpBB2 directory and its contents to your web root and install without any modifications, your forums will be available at http://www.yourdomain.com/phpBB2.
- You can simply rename the phpBB2 directory to something you like, say forum. In this case, your community will be located at http://www.yourdomain.com/forum.
- You have the option of hosting the board in your web root so that it's accessible directly at http://www.yourdomain.com/ or, if you use a sub-domain, something like http://forum.yourdomain.com/. If you decide to go this way, than you need to copy the contents of the phpBB2 directory in your (sub)domain's web root, which is not the phpBB2 directory itself, but the files and directories that are contained within it.
For the purposes of this tutorial, we'll go with the second option, http://www.yourdomain.com/forum, as it is probably the most common one.
- config.php: You need to change the permissions for this file so that it's writable by phpBB during the installation. Go to the main directory where phpBB is installed and find the file called config.php. Change the file permissions so that it's writable by the phpBB installer scripts, or in other words, on Linux systems, chmod it to 666 (or -rw-rw-rw-). On Linux/Unix systems, chmod is a command that means "change mode", and is used to adjust file permissions. File permissions specify who can do what to a particular file. Your options to change a file's mode include:
- If you have shell access to your Linux server, go to your phpBB directory and type chmod 666config.php. This will do.
- If you have FTP-only access, chances are your FTP client (the program you use for copying files to the remote server) will give you the option of chmod-ing, only you have to find it. In some FTP clients, this option is simply called chmod, in others it's under file properties or permissions.
- If you cannot change the file permissions, don't worry. If the phpBB installer cannot write this file during the installation, you'll be given the option of downloading the config.php file on your system and then FTP-ing the file, overwriting the one already in the phpBB root.
- Start the phpBB installer: Point your browser to the phpBB directory, which in our case is http://www.yourdomain.com/forum/. You'll be redirected automatically to the installation script, which is located at http://www.yourdomain.com/forum/install/install.php. You should see a screen like the one that follows.
- Installer data form: Complete the form that is presented on the installation screen. That's where your checklist from the previous section comes in handy. A description of the fields in this form follows, as some might not be so self-explanatory. In brief, most of the fields in this form are pre-filled by the phpBB installer; the ones you need to worry about are basically just the fields related to database name, username, password, and the administrator username, password, and email address.
Option Setting Default board language Since you haven't installed additional languages yet, English is the only option. Later on if you decide to use other languages, you can always change this setting. Database Type The database system you'll be using, most likely MySQL 4.x or MySQL 3.x Choose your installation method Install or Upgrade. Go with Install, since you have no previous phpBB installation. Database Server Hostname / DSN Usually localhost; refer to your checklist. Your Database Name Refer to your checklist. Database Username Refer to your checklist. Database Password Refer to your checklist again. Prefix for tables in database phpbb_ is the default value. After the installation, all tables in the database to do with phpBB will have this prefix in their name, such as phpbb_users, and phpbb_posts. It's not compulsory to use a prefix, but it's a nice way to tell your phpBB tables from all the rest, in case you have other non-phpBB tables in the same database. This also allows you, for example, to have two or more distinct phpBB installations that share the same database; you just need to use a different prefix for each installation. Don't use spaces in this prefix, otherwise the installer will return an error. It's a good idea to leave the default phpbb_ value for the prefix, if you don't have a reason to change it. Most of the phpBB modifications that you may want to install later on will assume this prefix. Admin Email Address Your email address. It will be used, for example, as a sender email address when phpBB notifies a user about a new private message. So a good idea is to supply a working email address that you check often. An email that represents your board, like admin@yourdomain.com, would be a good choice. Domain Name Your domain's name. The phpBB installation will probably figure it out, otherwise type it in yourself. Server Port The default is 80. Normally you don't need to change this value. Script path The relative path to your installation. Normally the phpBB installer will guess it properly and you wouldn't have to change it. Administrator Username The administrator username is an important one. There is no default, but using Administrator is a common choice. Administrator Password Choose it wisely and make it difficult to guess. This option cannot be left blank.
- Finish installation: Click the Install button. If everything so far was fine, you've filled out all the required data in the install form, and there were no error messages, phpBB will install successfully. Click Finish installation and move on to the post-installation tasks.
After you've installed phpBB, you need to perform a few post-install operations, namely to delete unneeded directories and to set some basic configuration options.
[edit] Additional References
- For instructions on Troubleshooting phpBB Installation, click here
[edit] Source
The source of this content is Chapter 2: Installing and Configuring phpBB of phpBB: A User Guide by Stoyan Stefanov and Jeremy Rogers (Packt Publishing, 2006).
