Create a knowledgebase with phpMyFAQ

Asked and Answered

Article from Issue 172/2015

Transform information into knowledge by deploying a phpMyFAQ-based database of frequently asked questions.

No matter how well documented your application, chances are you often end up answering the same queries again and again. Unless, of course, you deploy a solution that gives users answers to their frequently asked questions (FAQs). For individual coders and small developer teams, the idea of deploying a dedicated knowledgebase might sound like overkill. After all, why not just add a FAQ section to the project's wiki or README file? However, you shouldn't underestimate the value and usefulness of an application that allows you to organize and share knowledge with your users and contributors.

A dedicated knowledgebase is not merely a source of answers to common questions; it can also act as a community portal, where users can submit their queries, contribute their own replies and solutions, and engage in discussions. This exchange, in turn, can provide developers with valuable feedback and lighten the burden of providing support.

The trick is to choose the right software for the job of building and maintaining a knowledgebase. Several solid open source options are available, but you can't go wrong with phpMyFAQ [1]. This mature self-hosted application strikes a perfect balance between functionality and usability, which makes it an ideal solution for individual developers and companies.

Installing and Configuring phpMyFAQ

As the name indicates, phpMyFAQ runs on top of the classic web server, PHP, and MySQL stack. So, before you deploy the application on your server, you need to do some preparatory work. The following instructions assume that you use a Debian-based server and that you are connected to it from your regular machine via SSH. Start by installing the required components using the following commands as root:

apt-get update
apt-get install apache2 mysql-server mysql-client php5-mysql php5-cli php-apc

This command installs the Apache server, PHP, and MySQL database server, along with the PHP APC accelerator. The latter package is optional, but it helps to speed up phpMyFAQ. Next, create a MySQL database for use with phpMyFAQ. Use the following commands to connect to MySQL and create the phpmyfaq database:

mysql -uroot -hlocalhost -p

Grab the latest stable release of phpMyFAQ from the project's website. Unpack the downloaded archive, rename the resulting directory (e.g., phpmyfaq), and move it to the document root of the server. Create the attachments, data, and images directories inside the phpmyfaq folder and make them writable using the chmod 777 command as root.

On your machine, point your browser to (replace with the actual IP address of the server) to open a setup wizard. Provide the required database connection information, configure phpMyFAQ's basic settings and administration account, then hit the Install button to perform the installation.

Once phpMyFAQ has been installed, you can log in using the specified credentials and switch to the administration area by clicking on the Administration link in the upper-right corner of the interface. Although phpMyFAQ runs fine with the default settings, you might want to modify some options right from the start. To do this, switch to the Configuration section and press the Main configuration button. Here, you can tweak basic settings like the title of your phpMyFAQ installation, description, contact info, and so on (Figure 1).

Figure 1: phpMyFAQ offers plenty of configuration options.

In the FAQ records configuration subsection, you can toggle the visibility of newly added records, change sorting order, and enable or disable comments. If you want to link your phpMyFAQ installation to Twitter, you can do this in the Social networks configuration subsection. Once you're done editing settings, press the Save configuration button.

Although any visitor can sign up for an account, you can also populate the application with users manually. Click the Users link in the main navigation bar at the top to switch to the user management section. Here, you can add a new user as well as edit existing accounts (Figure 2). For each user, you can specify rights by ticking the appropriate checkboxes in the Rights section.

Figure 2: Editing an existing user account in phpMyFAQ.

To make it easier to group conceptually similar topics, you might want to create categories. For example, if you use phpMyFAQ to organize and share knowledge about a specific software product, you might want to set up categories like Installation, Usage, Troubleshooting, and the like. To add a category, switch to Content | FAQ categories and press the Add top-level category button (Figure 3). Give the new category a name and a short description, then specify owner and user permissions. Press Add category to save the new category.

Figure 3: phpMyFAQ lets you create categories for organizing FAQ articles.

Now, you can start populating phpMyFAQ with FAQ entries. To add a FAQ article, click on the Add new FAQ link in the Content section, select the appropriate category and enter a question and its answer. Add keywords and tags to make it easier to find the article and mark the article as Visible to make it visible and searchable. phpMyFAQ also allows you to add an attachment to a FAQ article, which can come in handy if you want to attach a screenshot, a software patch, or a document.

You can mark the FAQ article as sticky – so it always stays on top – as well as enable or disable comments. You also can set an expiration date for the FAQ article to avoid clogging the database with obsolete content. phpMyFAQ keeps changelogs of all previous versions of a FAQ article, so you can track changes made to the specific entry and roll back to a previous version, if necessary. To do this, pick the desired version from the Select Revision drop-down list. You can then edit the opened revision in a normal manner (Figure 4).

Figure 4: Editing a FAQ article.

The application can also be used to maintain a terminology database, which is done in the Content | FAQ Glossary section. To link a selection to a specific definition in the terminology database, use the <acronym></acronym> tags. This way, when you mouse over the linked text selection, the definition appears in a pop-up window.

The Content | FAQ News section lets you publish news and short notices on phpMyFAQ. This functionality can be useful to notify users and visitors about the latest news and developments. To create a news article, click on the Add news button, fill out the required fields, and specify the available options.

Using phpMyFAQ's export capabilities, you can save FAQ articles in several formats, including PDF, XML, and XHTML (Figure 5). To do this, switch to the Exports section, select the category you want to export, specify a sorting order, and choose the desired output format. Then press the Export your FAQ button. The application allows you to create snapshots of its database back end containing all the data for safe-keeping. Using the backup feature in phpMyFAQ is easy: Switch to the Backup section and press the Backup data button. To restore the databases, select a snapshot file in the Restore subsection and press OK.

Figure 5: You can export phpMyFAQ data in several formats.

The Dashboard section in phpMyFAQ's administration interface aggregates all key info and puts often-used functions at your fingertips (Figure 6). Here, you can get a quick overview of the number of visits, articles in the database, comments, and open questions. Links in the Dashboard palette let you add and edit FAQ articles and switch to the Open questions section. Using the appropriate buttons, you can also check for updates and verify your phpMyFAQ installation.

Figure 6: The Dashboard section provides a quick overview of key info.

As a user, you can use phpMyFAQ not only to get answers to your questions but also contribute to existing articles. You can comment on an article, rate it, and translate it (Figure 7). You can also print the article and save it in the PDF format, as well as share the article via popular social services, such as Facebook and Twitter.

Figure 7: Visitors and users can comment on FAQ articles as well as rate and share them.

The instant response feature lets you find specific answers more quickly. Click on the Instant Response link in the navigation toolbar, start typing the question or key words in the search field, and phpMyFAQ returns matching results. If you were granted editing rights, you can create new FAQ entries as well as edit existing ones. phpMyFAQ administrators have the ability to review and moderate FAQs and news comments. This is done in the Content | Comments section of the administration interface.

The application offers an easy way for users to submit questions. Click the Add question link in the navigation toolbar, enter your question, and press Submit. phpMyFAQ then returns a list of possible answers. If they don't answer your question, press the Submit button again to submit the question. All submitted queries are treated as open questions, and you can view them in the Content | Open questions subsection of the administration interface. To answer an open question, press the Answer the question button next to the question.

Final Word

Despite its name, maintaining a database of frequently asked questions is only one of phpMyFAQ's many talents. Using the application's functionality, you can provide instant support to your users and customers, keep them updated on the latest news, and give them the ability to share their knowledge with others. So, if you are looking for something more flexible than a static FAQ section on your website or in the README file, phpMyFAQ is definitely the way to go.


  1. phpMyFAQ:

The Author

Dmitri Popov has been writing exclusively about Linux and open source software for many years, and his articles have appeared in Danish, British, US, German, Spanish, and Russian magazines and websites. Dmitri is an amateur photographer, and he writes about open source photography tools on his Scribbles and Snaps blog at

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Organize Your Knowledge with Piggydb
  • Perl: Q&A for the Web

    Catalyst is the Ruby on Rails of the Perl universe. When you are developing a web application like a quiz, using the MVC framework is really convenient and helps keep the underlying components cleanly separated.

  • Workspace: PivotX

    Check out this full-featured solution for your personal or business blog.

  • Fresh Memory – Learning Aid

    When memorizing facts, learning, storing, and processing internalizes the subject matter. The Fresh Memory program offers various methods to help you anchor the facts in your memory.

  • PHP Script Archives

    As a PHP Programmer, you may occasionally find yourself at a dead end. Discovering the perfect code snippet, script, or class to use alongside your own code can save time and frustration.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More