Installing PHPWebAdmin

Overview

This page describes how to install hMailServer WebAdmin, the PHP administration front-end for hMailServer.

Prerequisites

  • Microsoft IIS (or any other PHP compatible web server on Windows)
  • PHP x86 versions starting with 7.4.0 but earlier than 8.0.0


While hMailServer may work with older versions of PHP, it has not been tested.
The current code is incompatible with PHP versions starting with 8.0.0 due to function deprecation.

Step 1: Configure PHP

A clean installation of PHP has many features and extensions disabled. Some of these needs to be enabled to be able to use PHPWebAdmin. If you have just installed PHP, you need to copy php.ini-production to php.ini and make the following adjustments. 

Enable COM support

PHP accesses hMailServer API using COM. COM support is not enabled by default in PHP.

To enable it, locate the Dynamic Extensions section in php.ini, and add the following line:

extension=php_com_dotnet.dll

Enable Session support

In PHP.ini, change the setting session.save_path to a folder where you want PHP to store session files. For example:

session.save_path = "C:\PHP\sessions"

Note: The directory must exist, and be writeable by the web server process..
 

Step 2: Configure hMailServer DCOM

PHP needs to have access to the hMailServer COM API. To do this, you need to configure DCOM permissions.

Step 3: Copy the PHPWebAdmin files

Copy PHPWebAdmin from the hMailServer directory to your web root directory. The web root differs between web servers so check your web server's documentation if you're unsure where your web root is located. Copy the entire PHPWebAdmin from C:\Program Files\hMailServer to your web root. Example: If your web root is C:/wwwroot, copy PHPWebAdmin to C:\wwwroot, so that you get C:\wwwroot\PHPWebAdmin.

Alternately, you can use the PHPWebAdmin folder where hMailServer installed, you will neede to point your webserver to that folder and set permissions as above.

Step 4: Configure PHPWebAdmin

Go to the PHPWebAdmin directory in the web root.

  1. Create a copy of the file named config-dist.php and give it the name config.php.
  2. The file config.php contains the basic settings for PHPWebAdmin and needs to be modified to correctly adjust it for your system:

    • Set the value of rooturl to the URL where the WebAdmin will be accessed.

      Example:
      $hmail_config['rooturl'] = "http://localhost/PHWebAdmin/";

Step 4: Use it

Point your web browser to http://localhost/PHPWebAdmin and log in with your hMailServer username and password.

When you upgrade your hMailServer installation to a later version, make sure to copy the latest WebAdmin from the hMailServer installation directory to your web directory. If you do not do this, you will get an error message when trying to access WebAdmin.

Common configuration errors

There's a few common set up mistakes. Read more in the troubleshooting guide.

 

 

Search documentation