What you’ll need:
- phpBB 3.2
As software developers the most important aspect of the development process is setting up a local development environment. The vast majority of web servers run on Linux systems, but most consumer operating systems use Windows. This doesn’t preclude Windows users from developing PHP applications though. There are a number of ways to do this, such as using an emulator like Vagrant to create a virtualised Linux environment or actually installing the Linux operating system on your computer. But the easiest approach is to simply install an application which will allow PHP, MySQL and Apache to run on a Windows machine and the application I most like for this is called WAMP.
WAMP is a free program which can be downloaded from http://www.wampserver.com/en/. Select your operating system type and click on the download link.
Once downloaded, open the installer and select your desired language (English or French are the only options at this time). From here, follow the prompts – the default options should be sufficient.
Once set up, navigate to the www directory that WAMP has created (usually C:\wamp\www). This is where the webserver files are served from. For the purposes of this tutorial I created a subdirectory in here called “demo”.
Firstly, download the latest version of the QuickInstall tool from GitHub at https://github.com/phpbb/quickinstall – QuickInstall is an invaluable tool for developers because it allows multiple boards to be created with pre-defined settings and later managed at just a few clicks. Why this is so important is if, for example, you are developing multiple extensions you can easily set up a different board – a vanilla, brand new board – to test and develop each one on individually.
Extract the QuickInstall zip file contents into the “demo” folder.
Now, download the latest phpBB version from https://www.phpbb.com/downloads/ – v3.2.0 at the time of writing. When you extract the contents from the zip file, copy the “phpBB” folder to your clipboard. Now, go to \www\demo\quickinstall-master\sources and paste the folder here. This will be the source board that QuickInstall will use to create a new forum.
Finally the “boards”, “cache” and “settings” directories in QuickInstall need to be writable by PHP. This is all that needs to be done to set up a basic congifiguration of QuickInstall. If you now navigate to http://localhost/demo/quickinstall-master/ in your browser the setup page will be displayed, automatically displaying the Profiles tab.
Under database settings, enter “root” as the user and leave the password blank (these are the default WAMP settings; if you used something different then it’s important that it’s reflected here). In a real world environment you would never want to have a blank database password, but as this is strictly a local set up that nobody else will be accessing it will not pose a security problem.
The rest of the settings can be left as-is. I would however recommend under the admin settings using an easily memorable username and password though, because you may be accessing this test board very regularly, and under the populate board settings checking the Yes option just so you have some test data to work with.
Once you Submit this form, the Boards tab will become visible.
You can modify some settings such as the board name if you wish (handy if, as mentioned above, you wanted to create a different board for each different extension you are developing) but the only field that needs to be explicitly defined is the database/directory name. In the past I have just used an incremental naming system (“test_board_1”, “test_board_2”, etc) so I will use test_board_1 for this example, but you can use any name you want.
Once you click Submit, the button will be hidden momentarily. This is okay – due to the test data being inserted into the database it might take a little time for the board to be created. It shouldn’t take more than about a minute, after which point you will be automatically redirected to your test board and logged in:
At this point the board has been created in www\demo\quickinstall-master\boards\test_board_1 and a database created called “qi_test_board_1”. A great feature of WAMP is that it comes with phpMyAdmin, a web-based tool for manipulating MySQL databases and running queries. This can be accessed at http://localhost/phpmyadmin and you will see the new database listed there:
By this point you have a fully functioning phpBB testing environment which you can modify as you desire. Most aspiring developers will already have a text editor of choice, but if you are new to extension development there are a number of tools you can start out with. Notepad++ (https://notepad-plus-plus.org/) is a simple but powerful text editor which has been on the scene for many years; and is free. It doesn’t have all the bells and whistles but it has syntax highlighting, auto-completion and a few other handy things which work well for PHP development. Another nice text editor which is a little more modern and feature-filled is Sublime (https://www.sublimetext.com). Technically it is a paid product, but you can download and use it for free if you can put up with periodic reminders to buy the program. Otherwise you can easily purchase a license on their site.
For more advanced developers a full-fledged IDE might be desirable and the best one I’ve used is PhpStorm. It’s the IDE of choice for a number of phpBB team members and has more features than you could possibly ever use; the highlights being powerful debugging capabilities, refactoring, testing facilities and version control integration (such as Git).
Now you can get started on your extension idea, or any other tweaks and modifications you wish to make to phpBB!