Blog

phpBB 3.3.14-RC1 available for testing

Posted by Marc in Uncategorized on October 22nd, 2024

We are excited to announce the release of phpBB 3.3.14-RC1, a new release candidate for the upcoming stable release of phpBB 3.3.14. This pre-release version is now available for downloading and testing.

Notable Improvements

phpBB 3.3.14-RC1 introduces a number of improvements aimed at enhancing the user experience and overall stability of the software. These include:

  • Distinct disabled and not installed Extensions in ACP: Extensions in the ACP will be displayed in separate lists depending on whether they are disabled or not installed yet. PHPBB-17359
  • Support force reparsing BBCodes via CLI: It is now possible to force reparsing BBCodes in posts, PMs, and similar elements. PHPBB-17402

Notable Bugfixes

This release candidate also includes fixes for several reported bugs, including:

  • AJAX error on deleting cookies: We fixed an issue that resulted in AJAX errors when deleting cookies on some pages. PHPBB-17398
  • Passing E_USER_ERROR to trigger_error in PHP 8.4: Passing E_USER_ERROR is no longer acceptable in PHP 8.4. This resulted in fatal errors in PHP 8.4. PHPBB-17384
  • Incorrect permission trace results: Tracing permissions in phpBB 3.3.13 sometimes returned incorrect results. PHPBB-17386
  • UCP not working when testing user’s permissions: It was not possible to test out the UCP when testing a user’s permission. PHPBB-17410

How to Get Involved

The phpBB team encourages everyone to download and test phpBB 3.3.14-RC1 extensively. User feedback is essential in ensuring a smooth and stable final release.

The packages can be downloaded from the official phpBB download page or the Area51 downloads section:

Language and Prosilver Updates

By testing this release candidate, you can help contribute to the quality of the upcoming stable version of phpBB.

phpBB 3.3.13-RC1 available for testing

Posted by Marc in Development on August 5th, 2024

We are excited to announce the release of phpBB 3.3.13-RC1, a new release candidate for the upcoming stable release of phpBB 3.3.13. This pre-release version is now available for downloading and testing.

Notable Improvements

phpBB 3.3.13-RC1 introduces a number of improvements aimed at enhancing the user experience and overall stability of the software. These include:

  • Delete Users by ID via console: Administrators can now delete users by their ID directly from the console, providing a more efficient way to manage user accounts. PHPBB-17347
  • Gravatar Avatar URL Update: We’ve implemented the new Gravatar URL format for avatars, ensuring compatibility with the latest Gravatar standards. PHPBB-17355
  • Enhanced PM Recipient Removal: The button for removing private message recipients has been improved, making it easier and more intuitive to manage message recipients. PHPBB-17317
  • Better Error Handling in PHP 8: We’ve improved how errors are handled in PHP 8, particularly those that were previously hidden, offering more reliable error reporting and debugging. PHPBB-17356

Notable Bugfixes

This release candidate also includes fixes for several reported bugs, including:

  • User lastvisit update frequency: We fixed the issue where the lastvisit timestamp for users was updated more frequently than necessary, resulting in unexpected behavior of the search functions like “New posts”. PHPBB-17375
  • Rehashing of phpBB2 passwords via cron after upgrade: An issue with the automated rehashing of older phpBB2 passwords via cron has been fixed, ensuring a smoother transition for users upgrading. PHPBB-17351
  • reCAPTCHA issues with registration errors: The issue with reCAPTCHA not displaying correctly on errors during registration has been fixed. PHPBB-17366

How to Get Involved

The phpBB team encourages everyone to download and test phpBB 3.3.13-RC1 extensively. User feedback is essential in ensuring a smooth and stable final release.

The packages can be downloaded from the official phpBB download page or the Area51 downloads section:

Language and Prosilver Updates

By testing this release candidate, you can help contribute to the quality of the upcoming stable version of phpBB.

phpBB Project Key Update in Tracker

Posted by Marc in Development on June 1st, 2024

Heads up to all phpBB contributors!

The project key in our JIRA tracker has been changed to start with PHPBB- instead of PHPBB3-. This means that going forward, new tickets will be numbered using the format PHPBB-12345 instead of PHPBB3-12345.

We’ve also updated other systems like the ideas page and our commit hooks in the phpBB source code to reflect this change. Don’t worry, though! All links and filters that include previously used ticket IDs starting with PHPBB3- will continue to work as expected.

This is a simple housekeeping update to streamline our ticketing system. If you have any questions or encounter any issues, feel free to reach out to the development team.

Happy coding!

phpBB 3.3.12-RC1 available for testing

Posted by Marc in Development on May 12th, 2024

We’re proud to announce the release of phpBB 3.3.12-RC1, a release candidate for the upcoming stable version of phpBB 3.3.12. This pre-release version is now available for downloading and testing.

Notable Improvements

phpBB 3.3.12-RC1 introduces a number of improvements aimed at enhancing the user experience and overall stability of the software. These include:

  • Improved handling of duplicate posts: This update addresses an issue where users might accidentally submit the same post multiple times. PHPBB3-17077
  • Optimized queries for unanswered topics and posts: Searching for fresh discussions on your forum should now be faster and more efficient. PHPBB3-17305
  • Enhanced error messages for PHP 8.1+ users: MySQL error messages have been improved for better readability when using PHP 8.1 or later versions. PHPBB3-17232

Notable Changes

The DOM handling when parsing posts has been updated for better compatibility with PHP 8.3. PHPBB3-17236

Notable Bugfixes

This release candidate also includes fixes for several reported bugs, including:

  • Improve handling of web root path to support PHPBB_USE_BOARD_URL_PATH in extensions: PHPBB3-17207
  • Update issue when YouTube profilefield does not exist: PHPBB3-17208
  • Prevent unexpected reparsing of URLs as magic URLs in posts: PHPBB3-17130
  • Missing update of user pass change time during password reset: PHPBB3-17302

How to Get Involved

The phpBB team encourages everyone to download and test phpBB 3.3.12-RC1 extensively. User feedback is essential in ensuring a smooth and stable final release.

The packages can be downloaded from the official phpBB download page or the Area51 downloads section:

Language and Prosilver Updates

By testing this release candidate, you can help contribute to the quality of the upcoming stable version of phpBB.

Attention developers: GitHub Codespaces enabled in phpBB!

Posted by battye in Development with the tags , , , on February 4th, 2023

If you’re a PHP developer, you’ll know that setting up a new development environment can be annoying and time consuming! You have to find a code editor, you have to install a web server like Apache, a database and PHP. Even if you’re using some virtualisation software like Vagrant or containerisation software like Docker to simplify the process, it still takes up time that you’d prefer to spend coding.

Enter: GitHub Codespaces.

The tech world is moving towards the cloud at a rapid pace and software development is no exception. A web-based project like phpBB is a good fit for cloud development and while a local development environment is wonderful, the ability to quickly code and test changes on any device with a browser is nice to have in the arsenal.

Codespaces includes a web-based code editor (VS Code) as well as a virtual machine which can be used to run software. Effective immediately, the phpBB project on GitHub contains a pre-configured Codespace with a LAMP stack and XDebug, allowing developers to modify and debug a vanilla board which is already automatically installed.

This tutorial explains how to:

  • Create a GitHub Codespace with an automatically created fresh installation of phpBB
  • Use a Codespace to make a code change to phpBB
  • Use XDebug to debug phpBB code in real time

Step 1

See if there is a ticket in the phpBB issue tracker describing the problem you would like to fix or the feature you would like to add. If there is not an existing ticket, you can create a new ticket, logging in using your phpBB.com login details.

In this case, we’ll look at a simple bug that was raised at https://tracker.phpbb.com/projects/PHPBB3/issues/PHPBB3-17025 – the number 0 appears as the default topic ID on the MCP move posts page, but there is no valid use case for this because it is an invalid ID. We will use this bug (resolved here) to demonstrate how GitHub Codespaces works and how it can be used for phpBB development.

The reporter provided some valuable information which acts as a good starting point, namely that the bug is on line 76 of prosilver/template/mcp_topic.html. We will come back to this in Step 3.

Step 2

Create a new branch on your own fork of phpBB. If you have never done this before, the procedure is outlined at https://area51.phpbb.com/docs/dev/3.3.x/development/git.html

Then on GitHub.com, create a new Codespace for this branch. It will already be preconfigured from the code in the phpbb/phpbb repository.

screenshot_create_codespace

This will create a brand new installation of phpBB with XDebug installed to assist developers.

Step 3

From the online VS Code website, which looks almost identical to the desktop version of VS Code, click on the files icon and navigate to mcp_topic.html – or use the shortcut Ctrl+P to search for the file.

screenshot_file_search

By looking at line 76 of that file, we can see that the “value” attribute listed in the ticket is set to a variable called TO_TOPIC_ID.

Using the Ctrl+Shift+F (global search) feature, if we search for that TO_TOPIC_ID variable we can see that it only gets used in one other place.

screenshot_global_search

Double click mcp_topic.php to open the other place where that variable is used – line 386 of the file.

The template variable is set to take the exact value of $to_topic_id.

Step 4

Using the power of XDebug, we can debug the issue in real time. Using the Ctrl+F (local search) feature, we can see where $to_topic_id is declared and how it is used.

On line 52 it takes input from the URL – and defaults to 0 if the parameter isn’t supplied in the URL. On line 357, it is forcibly set to 0 if a certain condition is met.

Line 376 is the best place to see XDebug in action though. Left click once just to the side of the line number so that a red breakpoint appears. A breakpoint is used to identify where execution should temporarily halt during debugging.

screenshot_breakpoint

Step 5

Now that a breakpoint has been set (you can set as many breakpoints as you wish), debugging can be turned on by clicking the “Run and Debug” button and then the green play button beside “Debug phpBB”.

screenshot_debug_on

Step 6

At this point, debug mode is active. Under the Ports tab at the bottom of screen, click the “Open in Browser” button and the fresh phpBB installation will open.

screenshot_open_site

Log in to the board with the credentials admin/adminadmin and, for the purposes of this example, add some posts and topics so that posts can be moved in the MCP to replicate the original bug.

Step 7

When the move posts page of the MCP is loaded, the XDebug breakpoint will automatically be hit – meaning the execution of the page is paused at that point to give developers the chance to analyse the code before it has finished running.

The browser tab will show a small red circle to indicate a breakpoint has been hit. Within VS Code, the line will be highlighted as well.

To identify the value of the variables at the point the execution has paused, either hover over a variable (like in the case of $to_topic_id on the right of screen) or look at the variable list on the left of screen.

screenshot_hit_breakpoint

Step 8

From this information, we learn that $to_topic_id is set to 0 as a default and it has been done intentionally. So to fix the bug of 0 appearing by default in the template, we don’t want to refactor the entire file and potentially introduce a new problem.

The sensible approach is to just change the way the value is passed to the template because, as we discovered from the global search in Step 3, the template variable does not get used anywhere else.

Using the ternary operator we can make a simple change so that the template variable declaration reads as:

‘TO_TOPIC_ID’ => $to_topic_id ?: ”,

This means that if $to_topic_id evaluates to true (the integer 0 does not evaluate to true, but if a valid topic ID is passed through the URL as explained in Step 4 it does evaluate to true), then $to_topic_id will be passed as the default value to the input field – otherwise, an empty string will.

Step 9

By returning to the tab with the phpBB board open, we can confirm that the fix is working as intended.

screenshot_bug_fixed

Step 10

Satisfied that the fix is correct, we can now commit and push the change to the local branch. This is easily done in VS Code, simply click the “Source Control” tab and stage the change to mcp_topic.php (the file we edited) by right clicking it and clicking “Stage Changes”.

Type a commit message in the box (using the format described at https://area51.phpbb.com/docs/dev/3.3.x/development/git.html), and then select “Commit and Push” from the dropdown option.

screenshot_commit_push

The list of files in the install directory can be safely ignored – they are deleted when setting up the Codespace to allow phpBB to run normally.

Step 11

Finally, create a pull request on GitHub.com from your local branch to either the phpbb/phpbb 3.3.x branch or the master branch. phpBB’s GitHub Actions will run unit tests, ensuring no features were broken accidentally as a result of the change, and then the development team will review the code.

And with that, it becomes clear that GitHub Codespaces is a really handy tool to be aware of and which can be used to easily and powerfully make code changes for phpBB.

“To the Future”

Posted by hanakin in Development, Styles with the tags , , , , , , , on September 16th, 2018

In 2007 phpBB stepped into a new era with its release of the now infamous “prosilver” theme. One decade ago we pushed the envelope of what a forum should look like, how it should function, and how we build and customise themes.

This year we are announcing our plans to go where no forum has ever gone before. We are starting on a journey to venture outside the scope of our current galaxy to a place far far away.

In search of an experience so groundbreaking, so shocking, that you will not want to miss the excitement. So suit up and strap on your jetpacks in preparation for the launch of something revolutionary. In the following blog post, we will be outlining the plans for the coming time and show you some screenshot of things we’ve been working on.

Over the course of the next year or so we will update you on the progress and outline everything in complete detail. For now, you can see the full scope of some of the components we’ve been working on over here.

In relation to this we are also standing up a new Front-end Development team, as we will be leveraging a lot of advanced forward thinking processes, techniques, common practices, and technologies; more to come on the specifics. To do this we will need to bring on several new motivated and talented individuals to work on and help oversee this mission through.

With that said if you think this is something you may be interested in and/or are qualified for, please private message or email me with your qualifications, examples and a brief description of why you think you would make a good addition to this project.

In the meantime head over to the to Styles in Development topic of the new style to track the status of the work and get further details and discussion to help contribute. You can also have a look at the repo over at Github and head over to the Area51 “Styles Development” forum for specific discussion related to the development itself.

Below are some more screenshots from the components we’ve been developing:

Chat based PM design

We’re in Budapest!

Posted by Jim Mossing Holsteyn in Development, Events on September 9th, 2017

After several months of preparations and many hours of travelling, most of our team members have arrived in Budapest for our annual team hackathon. Our meeting space was provided by L’Office Budapest. Their great team made sure we got to work in a nice environment in a lovely location. Thanks a lot for your hospitality!

    

Even though we’re only two days in, we’re already considering this meet-up another great success. Members from all of our different teams were present, along with GSoC student rubencm. We’ve been working on many different types of improvements for the project. A quick list of those improvements are as follows (even though we probably still miss a lot here):

  • Fixing loads and loads of bugs
  • Re-introducing phpBB Ideas
  • Working on exciting new features (such as installing extensions from the ACP)
  • Finishing up on the GSoC projects (more on that soon!)
  • Mass validation of new extensions
  • Website adjustments to improve user-friendliness
  • Additions of many new Knowledge Base articles and tutorials
  • Improvement of official Developer Documentation
  • Merging and fixing existing Pull Requests

Our party consisted of: CHItA, Crizzo, DavidIQ, Derky, Elsensee, hanakin, JimA, kasimi, Marc, Marshalrusty, Nicofuma, Paul, rubencm and stevemaury.

Here are some nice pictures to make you feel like you’re here with us!

 

  

Google Summer of Code 2017: Advertisement Management

Posted by Jakub Senko in Extensions on August 24th, 2017

Advertisement management is easily one of the most requested add-on features for phpBB. In phpBB 3.0, EXreaction’s Ad Management MOD was the 9th most downloaded MOD with over 66,000 downloads. For phpBB 3.1/3.2, community members ranked Ad Management as their 2nd most desired extension. The Extension Development Team at phpBB is happy to announce that we will be releasing an official Advertising Management extension for phpBB 3.2, created during our participation in the Google Summer of Code.

The extension developed by GSoC student Senky (see his code commits) and mentored by VSE and Derky covers most features board admins would need to implement ad code snippets or sell advertisement space on their boards.

How it works

At its most basic usage, an admin can paste HTML/JS code for an advertisement directly in ACP and select locations for this ad to display (14 locations are already available – along with pop-up and slide-up options). The ad will start to display immediately after it’s enabled.

Additional features

We’ve built into this extension various extra functionalities to help manage your board’s ads. You’re able to set a comment for each advertisement (i.e., info about advertiser, PPC, etc…). Set the priority level of the ad (ads with higher priorities will be displayed more often than other ads assigned to the same display location). Set a user as an owner of an ad, who is then able to see ad statistics in the UCP. Set an expiration date for an ad, after which the ad will automatically be disabled. The extension can analyse advertisement code for you, to check that your advertisement code is secure, optimised and safe to publish. You can also take advantage of the built-in banner upload mechanism to easily upload and create banner ads without having to use FTP or leave the ACP.

In addition to all that, the extension is able to count views and clicks for each ad, and optionally disable ads once they reach a certain number of views and/or clicks. If you designated an ad owner, they will be able to view their ads views and clicks stats in their UCP.

You can also disable advertisements from displaying to selected user groups, for example to allow your admins, moderators (or even registered users) an ad-free experience. We’ve also included an ad-blocker detector option that will display a polite message to users to consider disabling their ad-blocker on your site, in order to help support your site.

Performance

We did our best to optimise this extension for even the biggest boards – this extension performs only one additional database query (two with view counting enabled) per page load. However, we really look forward to your personal experiences with this extension to help us improve the performance and usability even more.

Future

This extension is not feature-frozen. We appreciate every comment, idea and bug report and will do our best to make this extension as powerful as possible without compromising performance.

You can track our continuing feature/planning list on Trello. We wish you the greatest revenues!

For extension developers

This extension is designed with extensibility in mind. Currently, it is already possible to accept new template locations defined in other extensions. If you have ideas on how to further extend this extension or would like to develop a rejected feature as an add-on to this extension, please ask us for any PHP/template events you may need us to add and we will be more than happy to prepare them for you.

Download

The extension is now available for download from our Customisation Database!

An alternative approach to setting up a development environment on Windows

Posted by battye in Development, Extensions with the tags , on May 29th, 2017

In the last article I looked at setting up a simple development environment on Windows using WAMP. If you would like to review that, please visit https://blog.phpbb.com/2017/02/28/how-to-set-up-a-development-environment-on-windows/

The longer you spend developing software, the more seriously you start to take setting up the perfect development environment. And the more seriously you start to take following best practices. One of these practices is setting up a development environment that matches the production environment that you are using. There are a couple of reasons why this is beneficial. Firstly, if multiple developers are working on a project then you can be sure that code written by one person will work for the other developers. And secondly, when that code is deployed to a production environment you know that it should theoretically work straight away seeing it was written in a matching development environment.

A simple example of failing to do this would be if a developer was using a PHP7 development environment and wrote a statement which included the spaceship operator. If this code was then deployed on a PHP5 environment, the code would not work. If the developer, knowing that the production environment runs PHP5, had set up their development environment accordingly this bug would have been noticed much sooner.

At first impression, it seems impossible that a developer writing and testing code on their Windows PC can set up a local development environment that matches their live web server which in the vast majority of cases is running on Unix. But this is actually not the case, it is possible – and in fact, not all that difficult – to do this.

It can be done using a couple of Windows programs that enable the creation of virtual Unix machines. Basically what this means is that you can set up a lightweight Unix server that runs within Windows, so you can still use your favourite Windows text editors and tools but when it comes to running the code it will be run in Unix. In this article I’ll be looking at Vagrant and VirtualBox.

Note: This article assumes basic knowledge of the command line on Windows and Unix.

 

SETTING UP VAGRANT, VIRTUALBOX and PUTTY

The first step is to install VirtualBox, which Vagrant supports out of the box. VirtualBox is a program which allows for the management of virtual machines and can be downloaded from: https://www.virtualbox.org/wiki/Downloads

Use the default set up options.

Now Vagrant needs to be installed. Vagrant runs alongside VirtualBox to allow users to quickly provision new and different types of development environments. It can be downloaded from https://www.vagrantup.com/downloads.html and once again the default installation options should be used.

You can confirm that it’s correctly installed by rebooting your PC, and then opening Command Prompt (cmd.exe) and running the command “vagrant”. This should return example usage options.

Note: Version 1.94 of Vagrant seems to have a couple of bugs, which I encountered trying to install this on a Windows 7 machine (I know, I know! But it’s the only Windows PC I had access to). The first resulted in a number of error messages when running the “vagrant” command. This was resolved by running “vagrant plugin install vagrant-share –plugin-version 1.1.8”. The second bug resulted in errors when running “vagrant up”, which I resolved by replacing 3 files – the procedure is explained at
https://github.com/mitchellh/vagrant/issues/8520#issuecomment-297792410 – it appears this will be resolved in v1.95.

With Vagrant now installed, create a folder on your PC where you want your Vagrant projects. I called mine VagrantProjects. In your command prompt window, “cd” into this folder. Then run this command: “vagrant init”. This will create a Vagrantfile. This is a file where development environment settings are stored.

Now run “vagrant box add ubuntu/xenial64” – this will add an Ubuntu 16.04 virtual box, a new release of Ubuntu. It is worth bearing in mind that there are plenty of other boxes you can choose from. Some even have the LAMP stack pre-installed which if you want to save time could be a good option. You can view a list at https://atlas.hashicorp.com/boxes/search

The download may take some time on slower connections. When it’s complete, open Vagrantfile and modify this variable to have the listed value:

config.vm.box = “ubuntu/xenial64”

Note: these steps can be combined if you simply run “vagrant init ubuntu/xenial64”
Then run “vagrant up” while still in that directory.

Watch the messages in the command prompt window for the SSH username and password. You will need to note these down so when the virtual machine is running you can log into it.

Once the VM (virtual machine) has booted, you can open the VirtualBox application to confirm that it has indeed been created. If you run “vagrant status” you will see that the state is running.

Next, run “vagrant ssh” – on Windows it likely won’t work. But it will provide some important information. The host/port/username will be shown again but so will “private key” – this path is important.

An SSH client needs to be installed now. This is a client that allows you to log in to a remote server – but in this case it can be used to log in to the virtual machine. Putty is a very lightweight and effective client, and can be downloaded and installed from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html – download both Putty and PuttyGen.

Firstly, open PuttyGen, click load, and the choose the private key path specified a moment ago. Then using the default settings, click save private key. I called it pg_private_key.ppk. This key is later used merely to authenticate you and grant you access to the virtual machine.

Now open Putty. In the first screen fill out these details, which should match the information Vagrant displayed to you earlier:

Host name: 127.0.0.1
Port: 2222

Now go to Connections -> SSH -> Auth -> Private key file for authentication and select the ppk file.

Under Connections -> Data you can enter under “auto login username” the username shown in the command prompt earlier. Then go to Sessions, and under Saved Sessions type “Vagrant”. Click “Save”. Now you will not have to perform this step again, you can simply double click “Vagrant” in the future to quick-load your VM.

Finally click open, and a new command window will appear. But this time, it’s your new virtual server!

From the Putty window, type “logout” to leave the session. And in the Windows command prompt window type “vagrant halt” to shutdown the virtual machine. “vagrant status” will confirm that the state is powered off.

 

INSTALLING THE LAMP STACK

The “Linux” part has been handled now, but to continue setting up a local development environment Apache, MySQL and PHP is still required.

Firstly, Apache can be installed by running the following commands (once you have logged into the VM through Putty):

sudo apt-get -y update
sudo apt-get -y install apache2
sudo rm -rf /var/www/
sudo ln -fs /vagrant/ /var/www

So that development can take place in Windows, but run on the Linux virtual machine there needs to be some level of directory synchronisation. The final two commands create a symbolic link so you can store your files locally but also run on the webserver in the virtual machine.

On your local machine, inside the VagrantProjects folder create a new folder called html/ – this is important because of the way Apache is set up. In that folder, create a file called index.html and put this in it:

<html>
<body>
<h1>It works.</h1>
</body>
</html>

Note: A shortcut for this can be followed by creating a script like the one at https://www.vagrantup.com/intro/getting-started/provisioning.html

Now open Vagrantfile and add the following entry:

config.vm.network :forwarded_port, guest: 80, host: 4567

Now run “vagrant halt” followed up by “vagrant up” to restart the virtual machine.

Go to http://127.0.0.1:4567/index.html in your browser and you will see the file created above.

With Apache now running, let’s install MySQL:

sudo apt-get -y install mysql-server php7.0-mysql

When prompted, choose a password for the MySQL database.

You can test the connection from the command line (still using the Putty window, as it’s local to the virtual machine) by typing this command:

mysql -h 127.0.0.1 -u root -p

… and entering the password chosen above.

Pro tip: if you wanted to quickly run an SQL query, you can do it by typing the query after you’ve run the previous command. Type “CREATE DATABASE test;” to try it out. Enter “exit” to exit from the query window.

Now to install PHP7:

sudo apt-get -y install php libapache2-mod-php

phpBB requires the XML/DOM extension, so also run this:

sudo apt-get -y install php-xml

Now create a file called phpinfo.php in your html/ folder, and put this in it:

<?php
phpinfo();
?>

And then run http://127.0.0.1:4567/phpinfo.php and you will see that PHP is running correctly. As this demonstrates, any files or subdirectories you put in the /html directory become accessible through the web server.

By this point, you have everything you need to install phpBB and you can use the “test” database that was created in an earlier step.

 

INSTALLING PHPMYADMIN

To install phpMyAdmin – a fantastic tool for viewing database tables and running queries in a visually appealing way – do the following. Run:

sudo apt-get -y install phpmyadmin

Select apache2 by pressing enter, when prompted. Then select “yes” when shown the dbconfig-common prompt. Finally enter your MySQL password.

Now run the following database queries (on the command line, using the mysql command demonstrated in the previous section):

GRANT ALL ON test.* TO phpmyadmin@localhost IDENTIFIED BY ‘password’;
FLUSH PRIVILEGES;

This creates a database user called phpmyadmin (with a password of your choice, specified in the command above) with access to the test database created earlier.

Then run this command:

sudo vim /etc/apache2/apache2.conf

This will open the vim text editor. Press “i” to enter text edit mode. Then add the following line at the end of the file:

Include /etc/phpmyadmin/apache.conf

Press “Escape”, then “:wq” to save and exit the file.

With this done, you will now be able to log into phpMyAdmin by visiting this URL – http://127.0.0.1:4567/phpmyadmin/ – after logging in you can see the dashboard and view your tables and run queries.

With this complete, you now have a working development environment running on Linux with Apache, PHP and MySQL installed along with phpMyAdmin.

How to set up a development environment on Windows

Posted by battye in Development, Extensions with the tags , on February 28th, 2017

What you’ll need:

  • WAMP
  • QuickInstall
  • 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 – 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.

q_1

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.

q_2

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:

q_3

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:

q_4

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!