Now that you have a general idea of what phpBB is, it is time to install it on your server or your personal computer and to start using it. 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. There are also some post-installation tasks that you need to perform once phpBB is installed on your system. In this second chapter of the book you will learn:
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.
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:
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.
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.
Now that you're clear on the requirements, let's explore the options for the system to install phpBB to:
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.
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/.
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.
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.
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.
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.
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".
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. bin
directory, where you'll find several MySQL executables. mysql -u root -p
. root
with a blank password is the default MySQL account. If you have changed this password, type it in. mysql
prompt if you've successfully connected. Type CREATE DATABASE forums
; and hit Enter. Do not forget the semicolon at the end. SHOW DATABASES
; and hit Enter. You should see your newly created database in the list. exit
, hit Enter and MySQL will politely say Bye
to you. exit
again to close your command prompt.In this case the process may vary considerably depending on your specific hosting package and its limitations. Here are some possible scenarios:
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.
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:
localhost
or 127.0.0.1
. In the case of ODBC, a DSN is needed instead.)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.
3.144.33.41