Installing PHP and Zend Extensions on Windows Azure Websites
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).
- Once you have the DLLs in hand, create a folder called bin under /site/wwwroot using your favorite FTP client (or Web Matrix)
- Upload the DLLs to the bin folder.
Configuring the website on the portal to load the extensions
- Go to the Windows Azure portal
- Select your website and go to the Configure tab, scroll down till you reach the App Settings section
- For PHP extensions, create a PHP_EXTENSIONS key, for Zend extensions, create a PHP_ZENDEXTENSIONS key
- For values, type in the locations of the DLLs as shown in the picture
- Save the configuration, and load up your phpinfo test page, behold:
- 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.
Note: This post originally appeared on my MSDN blog at http://blogs.msdn.com/b/africaapps/archive/2013/12/23/installing-php-and-zend-extensions-on-windows-azure-websites.aspx