Microsoft Azure Open Source Development Support Team Blog

Support for Open Source Technologies on Microsoft Azure App Service

WordPress Migration: Easy as A-B-C, 1-2-3

Fig 1. WordPress Migration Components There are 3 steps to migrating a WordPress website to Azure App Service Web Apps. Copy WordPress files Migrate the MySQL Database Configure WordPress   Step 1. Copy WordPress files Make a backup of the current WordPress website. Tools commonly used for this is FTP Software like FileZilla or WinSCP…. Read more

Send email on App Service using Office 365 (O365)

For PHP – This is a Proof of Concept to send email using the PHP Mailer library and Office 365. From the PHPMailer GitHub site, follow the “Minimal installation” section and download class.phpmailer.php and class.smtp.php. Copy-paste the code from “A Simple Example” section or use the following: <?php require ‘class.phpmailer.php’; require ‘class.smtp.php’; $mail = new… Read more

Best Practices for WordPress Security on Azure

This article was put together by Mangesh Sangapu and Yi Wang. Shout-out to Cory Fowler and Sunitha Muthukrishna for additional tips. WordPress Security is often an overlooked feature. Customers are quick to configure their site, but often forget to fine tune the security aspect. Here we have compiled steps that will help make your WordPress site… Read more

MySQL In-App Configuration for PHP Content Management Systems

Read more about MySQL In-App here. Content Management Systems such as WordPress, Drupal, Joomla contain the database credentials within a configuration file. If you decide to use MySQL In-App for development purposes, you will quickly realize that you need to modify these credentials to work with MySQL In-App. Below is a table containing the default… Read more

WordPress: Redirecting to wrong URL!!

Problem: While trying to browse to http://www.example.com, it keeps redirecting to http://example.azurewebsites.net!!   Redirection Scenarios There are a couple situations where one may face the WordPress Redirection issue: Migrated from another host Changed your custom domain name and it’s going to your old domain!   Understanding The Issue This redirection can occur for two reasons: URL… Read more

WordPress MultiSite 404 on Admin Dashboard

If you are experiencing a 404 when switching to the dashboard of a given site, verify the web.config is accurate. We’ve found that older versions of WordPress have incorrect rules within web.config. Try the following web.config: <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <system.webServer> <rewrite> <rules> <rule name=”WordPress Rule 1″ stopProcessing=”true”> <match url=”^index\.php$” ignoreCase=”false” /> <action type=”None” />… Read more

Azure SDK for PHP: Updating Blob Properties

Here is sample code to update Blob Properties using Azure SDK for PHP. This code will traverse through all the blobs within the specified container and update the cache-control to “public, max-age=604800”. define(“__BLOBNAME__”, “name”); define(“__CONTAINERNAME__”, “container”); define(“__BLOBKEY__”, “key”); require_once(‘WindowsAzure\WindowsAzure.php’); use WindowsAzure\Common\ServicesBuilder; use WindowsAzure\Common\ServiceException; use WindowsAzure\Common\CloudConfigurationManager; use WindowsAzure\Blob\Models\Block; use WindowsAzure\Blob\Models\CreateContainerOptions; use WindowsAzure\Blob\Models\ListContainersOptions; use WindowsAzure\Blob\Models\CreateBlobOptions; use WindowsAzure\Blob\Models\CommitBlobBlocksOptions;… Read more

Triggering the PHP Process Report on Azure Web Apps

The PHP Process Report can be a vital tool in troubleshooting slowness or errors with your PHP Web Application. This article covers how to trigger the report based on a rule. Reference Apurva Joshi has a great article on Diagnostics as a Service (DaaS) for Azure Websites located here: https://azure.microsoft.com/en-us/blog/new-updates-to-daas-diagnostics-as-a-service-for-azure-websites/ Details on the Azure Web… Read more

PHP ImageMagick on Azure Web Apps

This post is outdated. See alternatives: PHP 7 x64 ImageMagick 6.9.3.7 Site Extension. This can be installed through the Azure Portal or the SCM/Kudu > SiteExtensions area. https://github.com/snobu/php-imagick-webapps for PHP 7.0 steps.       While this post is outdated, the steps to enable this SiteExtension is still helpful. Not all versions of the Windows Application… Read more

WordPress: Error establishing a database connection

If you see the infamous “Error establishing a database connection“, enable WordPress Debug Logging by following the steps outlined here: http://blogs.msdn.com/b/azureossds/archive/2015/10/09/logging-php-errors-in-wordpress.aspx     Debug.log will be saved within wp-content folder. Possible error messages in debug.log: [25-Jul-2016 15:34:44 UTC] PHP Warning: mysqli_real_connect(): (HY000/1045): Access denied for user ‘be96d626d450b1’@’23.102.165.199’ (using password: YES) in D:\home\site\wwwroot\wp-includes\wp-db.php on line 1490 [25-Jul-2016 15:34:44… Read more