Install the PHP interface

If you want to provide interactive access to your RefDB databases through the web, consider installing the PHP web interface. This web frontend provides a convenient way to perform the most common user tasks, like running queries or adding datasets.

Prerequisites

Please check the following prerequisites on your computer before attempting to install the PHP interface

Web server

Any web server that is capable of running PHP scripts. If you don't run a web server anyway, Apache is always a good choice to start with. Both versions 1.3.x and 2.x will work just fine.

PHP interpreter

You need PHP5, the older PHP4 won't do. When building PHP, make sure to configure the software appropriately so the php5 Apache module gets built. If you install a prebuilt package, you may have to select an extra package that contains the appropriate module for your web server.

With the exception of session support, the RefDB PHP interface relies solely on core features of PHP5. You may therefore have to install PHP5 session support separately. However, on some systems like FreeBSD, "core" does not mean "it's there". If the PHP5 core is split into several packages, you may also have to install DOM, XML, and XSL support separately.

Web server configuration

The following instructions assume that you use Apache as your web server. The configuration file is usually /etc/apache/httpd.conf or /usr/local/etc/apache/httpd.conf.

  • Locate the section "Dynamic Shared Object (DSO) Support". Check if the php5 module is loaded anyway. If not, add a line like the following:

    LoadModule php5_module    libexec/apache/libphp5.so
    	  
  • The subsequent section in the config file needs to be updated too if you had to add the php5 module:

    AddModule mod_php5.c
    	  
  • Further down there should be a section containing Aliases. Create a new one within this section like this:

        Alias /refdb/ "/usr/local/share/refdb/www/"
    
        <Directory "/usr/local/share/refdb/www">
            AllowOverride None
            Order allow,deny
            Allow from all
            AddType application/x-httpd-php .php .phtml
        </Directory>
    	  

    The paths point to the files that RefDB installs with all other shared files. If you intend to customize or modify the interface, you can copy the files to a directory in your home folder and change the directories in the config file accordingly.

  • Finally you'll have to let the Apache server re-read it's configuration file:

    ~# apachectl restart

Test your PHP interface

To see the PHP interface in action, first make sure that the RefDB application server is running:

~# refdbctl start

Now start your web browser and point it to:

localhost/refdb/

Please note the trailing slash! Now you should be greeted by the login screen.