Azure App Service Web Apps - Install Mail package using composer

2 minute read | By Prashanth Madi

For Information about installing MediaWiki on Azure : 

  [This Blog provides an easy way of setting the email client on mediawiki. Below are step by step instructions for doing this:

1)  We need to edit the compose.json file located in the root folder of your website. You can edit your site using WebMatrix.

     Please add the following in the composer.json file and save the file

 "repositories": [
 "type": "pear",
 "url": ""
 "require": {
 "php": ">=5.3.2",
 "psr/log": "1.0.0",
 "": "1.9.4",
 "": "1.2.0",
 "": "1.8.5",
 "": "1.6.1"

   The edited file should look like this:

2) Download the composer.phar file from

Save this file in the wwwroot folder of your site using an FTP client.


3) Please connect to the “Debug Console” for your site in Kudu by browsing to:


[4)   Install packages in composer.json using below command

php composer.phar install


  5)  If you are using Gmail account, please add the following code at the end of localsettings.php file in the root folder and replace the IDHost, username and password with your credentials:


$wgSMTP = array(
 'host' => "ssl://", // could also be an IP address. Where the SMTP server is located
 'IDHost' => "", // generally this will be the domain name of your website (aka
 'port' => 465, // Port to use when connecting to the SMTP server
 'auth' => true, // Should we use SMTP authentication (true or false)
 'username' => "", // Username to use for SMTP authentication (if being used)
 'password' => "YourPassword" // Password to use for SMTP authentication (if being used)


6) Restart Your website by clicking on Restart in the Azure portal.


Testing :

1)  Browse to your website’s main page. For example:

2) Click “Create account” on top right

3) Enter details on the account creation page and click Submit.

4) Check if you received an email.  


If you haven’t received any email, include the lines of code below in LocalSettings.php to check errors on the webpage. Make sure to remove them before moving to production.

error_reporting( -1 );
ini_set( 'display_errors', 1 );


Note: Please note that PEAR extensions are not officially supported for Web Apps. It would be great to have a feedback item open for voting so we can evaluate overall priority for customers. You can post on this subject on the feedback forum here