Introduction

You are creating a PHP website on Windows Azure and need to install additional PHP extensions not provided by default (like MongoDB or IonCube), you’ve come to the right post. It is quite easy.

Downloading and uploading the extensions

I’m going to demo this with 2 extensions; MongoDB and IonCube. The first is a regular PHP extension, and the second one is a Zend extension.

It is important that you download the 32-bit version of the DLLs (unless you are using a Standard website instance and specified that it runs on 64-bit), and also download the Non Thread Safe versions (if provided).

  1. Once you have the DLLs in hand, create a folder called bin under /site/wwwroot using your favorite FTP client (or Web Matrix)
  2. Upload the DLLs to the bin folder.

Configuring the website on the portal to load the extensions

  1. Go to the Windows Azure portal
  2. Select your website and go to the Configure tab, scroll down till you reach the App Settings section
  3. For PHP extensions, create a PHP_EXTENSIONS key, for Zend extensions, create a PHP_ZENDEXTENSIONS key
  4. For values, type in the locations of the DLLs as shown in the picture
    image
  5. Save the configuration, and load up your phpinfo test page, behold:
    image
    image
  6. If you want to load multiple extensions, just comma separate them in the App Settings but make sure not to leave any spaces between the comma separated paths, otherwise the platform won’t be able to find the file and load it.