Step 2: Upgrading and Configuring PHP

Follow these steps to upgrade PHP if you are running an older version. Depending on the MassTransit version you have, you need the following PHP version:

Note: PHP version 5.5.x requires that you have Microsoft Visual C++ Redistributable for Visual Studio 2012 x86 or x64 bit installed.

To determine your current version of PHP:

  1. Open Windows Command Prompt as an administrator (go to Windows Start and type cmd in the search box, then right-click the Command Prompt icon and select Run as Administrator)
  2. Type the following command (where C:\php is your current PHP installation folder):

    C:\php\php -v

    The first line of the output will display the version of your current PHP installation.

Backing up your current PHP folder and php.ini file

Note: If you are running the recommended or newer PHP version for your MassTransit version, go directly to the Configuring your PHP section below.

Note: These instructions assume that your operating system is installed on the C:\ drive.

  1. Stop the Internet Information Services (IIS) website that is associated with MTWeb. To do so:
    1. Open the IIS Manager from Windows Start > Administrative Tools > IIS Manager.
    2. In the Connections pane, expand the server name, expand Sites, and click Default Web Site.
    3. Under the Manage Web Site section in the Actions pane, click Stop.
  2. Back-up the php.ini file and delete it from its current location. Depending on the PHP version you want to install, it is located in:
    1. For PHP 5.3.1, C:\Windows
    2. For PHP 5.3.3 and newer, C:\php
  3. Back up and delete your current php installation folder. For example, C:\php.

Upgrading your PHP

  1. Download PHP from the MassTransit Latest Releases web page.
  2. Extract the zip file into a new folder called php—for example, C:\php. It is strongly recommended to create the PHP folder on the same drive where your operating system is installed. Installing PHP on a different drive will prevent MTWeb from working properly.

    Warning: Don't use the PHP installer—only extract the zip package as stated above.

    Note: If you don't see all of the required PHP files mentioned below after using Stuffit Expander, try extracting the zip file with another application.

    Windows Server 2008 R2 Service Pack 1 is the oldest Windows Server version that PHP 7.x supports. If your Windows Server version is older, you have to use PHP version 5.5.x or earlier. PHP version 7.x requires that you have Microsoft Visual C++ Redistributable for Visual Studio 2015 x64 bit installed.

    Windows Server 2003 and Windows XP are the oldest Windows versions that PHP 5.5.x supports. If you intend to use MassTransit on Windows Server 2003, you will need PHP version 5.4.x. PHP version 5.5.x requires that you have Microsoft Visual C++ Redistributable for Visual Studio 2012 x86 or x64 bit installed.

Configuring your PHP

Warning: Since you have PHP already installed and it might be running other websites, you must configure your php.ini file according to the configurations in your backed up php.ini file (usually, in your C:\Windows or C:\php folder, see Backing up your current PHP folder and php.ini file above). Any changes to the php.ini file require a restart of your web server.

  1. Confirm that the PHP installation folder has appropriate system permissions. To do so:
    1. Locate the PHP installation folder. In this example, C:\php.
    2. Right-click the folder, and select Properties.
    3. In the PHP Properties window, select the Security tab.
    4. Confirm that the machine's Network Service user has Read, Execute, and List permissions for the PHP installation folder.

      Note: The Network Service user rarely shows up explicitly, but is a member of the Users group. Depending on the security structure for the machine, you may want to add the Users group to the PHP folder (and propagate permissions to the files and folders within it), or add only the Network Service user.

  2. Open the PHP installation folder (in this example, C:\php), and create a folder called tmp. Grant the Windows user account associated with the IIS website that MassTransit will use (generally, IUSR) write access to the new tmp folder.

    Note: There is a known issue with PHP, which may require that you setup additional permissions. For more information, refer to this knowledge base article: https://kb.acronis.com/node/47136.

  3. Navigate to the WebRoot folder. It is located in:
    1. for MassTransit 7.1.x and later: ~\MassTransit Server\MTWeb
    2. for MassTransit 7.0: ~\MassTransit Server 7\MTWeb
  4. Grant the Windows user account associated with the IIS website that MassTransit will use (generally,IUSR) write permissions for the MT-PHPLog.log file. If you have a version of MassTransit older than 7.1, you must manually create an empty file named MT-PHPLog.log, first.
  5. Rename the php.ini-production file located in your PHP folder to php.ini.
  6. Open the php.ini file by using a plain text editor and change it according to the steps below.

    Note: All lines beginning with a semicolon (;) in the php.ini file are considered commented and therefore ignored. Ensure that you delete the semicolons (;) at the beginning of the lines from the php.ini file mentioned below.

  7. Change the line beginning with display_errors = as shown below.

    display_errors = Off

  8. Change the line starting with doc_root = as shown below (if the MassTransit was installed in the default location):
    1. on 64-bit machines:
      • for MassTransit 7.6 and later:

        doc_root = "C:\Program Files (x86)\Acronis\MassTransit Server\MTWeb\WebRoot"

      • for MassTransit 7.1 to 7.6:

        doc_root = "C:\Program Files (x86)\Group Logic\MassTransit Server\MTWeb\WebRoot"

      • for MassTransit 7.0:

        doc_root = "C:\Program Files (x86)\Group Logic\MassTransit Server 7\MTWeb\WebRoot"

    2. on 32-bit machines:
      • for MassTransit 7.1 to 7.6:

        doc_root = "C:\Program Files\Acronis\MassTransit Server\MTWeb\WebRoot"

      • for MassTransit 7.0:

        doc_root = "C:\Program Files\Group Logic\MassTransit Server 7\MTWeb\WebRoot"

  9. Change the line beginning with extension_dir = as shown below.

    extension_dir = "C:\php\ext"

  10. Change the line beginning with cgi.force_redirect = as shown below.

    cgi.force_redirect = 0

  11. Change the line beginning with cgi.fix_pathinfo = as shown below.

    cgi.fix_pathinfo = 1

  12. Change the line beginning with fastcgi.impersonate = as shown below.

    fastcgi.impersonate = 1

  13. Add the following lines to the Dynamic Extensions section of the php.ini file.

    extension=php_mysql.dll

    extension=php_mysqli.dll

    extension=php_soap.dll

  14. Create a directory named tmp within the PHP folder. Then, uncomment and change the line beginning with session.save_path = "\tmp" as shown below.

    session.save_path = "C:\php\tmp"

  15. Uncomment and change the line beginning with upload_tmp_dir = as shown below.

    upload_tmp_dir = "C:\php\tmp"

    Note: The Windows user account associated with the IIS website that MassTransit will use (generally, IUSR) needs to have Write access to the tmp folder.

  16. Change the line beginning with session.cache_limiter to blank as shown below.

    session.cache_limiter =

  17. Edit the following lines to enable PHP logging for troubleshooting purposes.

    error_reporting = E_ALL
    log_errors = on
    error_log = "MT-PHPLog.log"

    Note: The Windows user account associated with the IIS website that MassTransit will use (generally, IUSR) needs to have write access to the log file. By default, if you don't specify a folder, the log file location will be your Webroot folder.
    If you don‘t want to grant this user account full access to a folder, you may create an empty log file with this name manually, and then grant the Windows user account Write access to that file only.

  18. [Skip this step if using PHP 5.4.5 or later] Change the line beginning with magic_quotes_gpc = as shown below.

    magic_quotes_gpc = Off

  19. Make the following changes to support HTTP upload.
    1. Set the maximum allowed size for uploaded files via HTTP to a value applicable for your web server, by using the upload_max_filesize = setting.
    2. Set the post_max_size = setting to a value greater than the maximum allowed size for uploaded files via HTTP, but less than or equal to 2047M.

      Note: The PHP default size for the upload_max_filesize = 2M, and the post_max_size = 8M. If, for example, you want users to be able to send files to your server that are 150 MB, then set the upload_max_filesize = 150M, and the post_max_size to 200M. It is recommended that you set the post_max_size to be slightly higher than the upload_max_filesize but it should not exceed 2047M.

      The upload_max_filesize number is the largest size any file can be. For example, you can limit users to sending files to your server that are only 50 MB or less. However, the post_max_size defines the total post that can come to the server.

      In this example, if you set that to 230 MB, then a user could send four 50 MB files to the server and it would work, because 4 x 50 = 200 and this is smaller than the 230 post_max_size. But the user could not send one 50 MB file and one 100 MB file, because 100 MB is larger than the upload_max_filesize value.

      The largest allowable size for an HTTP upload is 2GB, which you can specify as 2047M.

    3. Set the maximum allowed number of files that will be uploaded in a single transfer, by using the max_file_uploads setting.
    4. Set the maximum allowed time for a single upload file transfer via HTTP to a value applicable (see the Note below) for your web server by the max_input_time setting.
    5. Set the max_execution_time setting to a value greater than the maximum allowed time for a single upload file transfer via HTTP.

      Note: The PHP default value for max_input_time = 30 and the max_execution_time = 60. The maximum time for transfer is limited by the IIS timeout parameter, which cannot be greater than 3600 seconds. Setting the value to the possible maximum of 3600 for both the max_input_time and the max_execution_time is recommended.

  20. Save the php.ini file and close the application that you used to edit it.
  21. Verify that the php_mysqli.dll library file is included in the C:\php\ext\ folder.

PHP setup is now complete.

Note:To increase MassTransit web performance, you can use the Windows Cache Extension for PHP. You can find its installation file at http://sourceforge.net/projects/wincache/files/wincache-1.1.0/wincache-1.1.0-5.3-nts-vc9-x86.exe/download. For instructions on how to set Windows Cache Extension for PHP, refer to http://us3.php.net/manual/en/wincache.installation.php.
Please, use the link above. Don't use the Windows Platform Installer because it will install a conflicting copy of PHP.