WordPress Troubleshooting Techniques on Azure Websites
WordPress is one of the popular Web Applications that is offered with Azure Websites Gallery to build dynamic websites. You may run into some issues with your WordPress websites and might want to troubleshoot them. In this post, we will review some common issues and discuss the best techniques to resolve them.
How do I update PHP INI configuration for my WordPress site?
Your WordPress site may require specific changes to PHP.INI based on requirements for your application such as allowing users to upload a file up to 12 MB which is higher than the default limit 8MB .
You can enable a user-defined PHP configuration, by creating a file called .user.ini at the site root (D:\home\site\wwwroot folder) and add the following:
upload_max_filesize = 12M
Now, restart your website. To verify if your changes were overwritten, create a PHP file called phpinfo.php with the following text and save it in the site root folder.
Next, browse this file and search for upload_max_size:
My Media content (uploads folder) is 10GB in size and my Web Application is 1GB in size. Which Tier will give me ample storage ?
The Storage supported for Shared is 1 GB, Basic is 10GB and Standard is 50GB. If you want to make the most of your website storage , you can move all of your media content into the uploads folder to Azure Storage (which costs $0.048 per GB) and use an Azure Storage plugin to manage media content in your WordPress site. This allows you to isolate your media content from your Web Application.
You can also create an Azure CDN endpoint for the Azure Storage account you used to serve your media content. In the plugin settings page, you’ll see a CNAME property setting. This is where you will need to enter the Azure CDN name for example http://az628210.vo.msecnd.net/.
How to setup SSL for my WordPress site
Only Standard and Basic Tiers offer SSL support. To add SSL support to your website :
Can I use mod-rewrite on Azure Websites?
Azure Websites use the IIS web server and hence does not work with mod_rewrite which is an Apache module. Url Rewrite module is enabled by default on Azure websites and you can create your rewrite or redirect rules using a web.config.
Open the Web.config file located at the site root (D:\home\site\wwwroot). If you do not have a Web.config file in the directory, create it.
Copy and paste the following XML section into the system.webServer element:
This rule matches any requested URL; if the URL does not correspond to a file or a folder on a file system, then the rule rewrites the URL to Index.php and determines which content to serve based on the REQUEST_URI server variable that contains the original URL before it was modified by the rule.
To learn more about creating URL rewrite rules ,see 10 URL rewriting Tips and Tricks
How to resolve 404.3 “Mime Type missing” errors when dependent requests on .woff files ?
.woff extension is not enabled by default on Azure Websites. If you are using WordPress or any application that uses .woff files, include a web.config file at the site root folder and add the following under
Now, restart your website.
How to resolve slow page load time for WordPress site running on Azure ? If your WordPress site is slow then check for these:
How do I get diagnostics for PHP errors? Websites allows you to turn on Webserver diagnostics such as Web Server logging, Detailed Error messages and Failed Request Tracing. To learn more about getting error information, see PHP diagnostics for Azure Websites Our new Diagnostics as a Service (DaaS for short), attempts to interpret these logs in a way that it either helps me resolve the issue or provides prescriptive guidance. To learn more, DaaS – Diagnostics as a Service for Azure Web Sites
How to enable advanced WordPress Debugging? WordPress provides various options to debug your WordPress site. WordPress uses a constant WP_DEBUG to turn ON debugging for your WordPress site. By default it is turned OFF in wp-config.php file
define('WP_DEBUG', false); To enable it, you need to set it to TRUE
define('WP_DEBUG', true); Note that debugging should be turned be turned OFF after debugging an issue. For more advanced options for debugging WordPress, see Debugging in WordPress.
How do I enable Email service with my WordPress site? Azure Websites does not support Email/SMTP and hence you would need to purchase SendGrid from the Azure Store. SendGrid offers a Free plan (up to 25,000 emails per month) which might be sufficient for your WordPress site. You can learn about SendGrid Plans for Azure here if the Free plan does not meet your needs. To learn more, How to Use SendGrid Email Service.
How do I backup and restore my WordPress site? Azure Websites offers automatic Backup and Restore feature. To learn more check out How to back up your Azure Website and How to restore your Azure Website.
Can I edit my WordPress site online? Websites comes with an online editor with the goodness of Visual Studio. To learn more, see Edit Azure Website online with Monaco.
How to Fix the Error Establishing a Database Connection in WordPress? You get this error when WordPress is unable to establish a database connection. The following reasons could be the reason why the issue occurs:
define('WP_ALLOW_REPAIR', true); Once you have done that, you can see the settings by visiting this page: http://www.yoursite.com/wp-admin/maint/repair.php The user does not need to be logged in to access this functionality when this define is set. This is because its main intent is to repair a corrupted database, Users can often not login when the database is corrupt. So once you are done repairing and optimizing your database, make sure to remove this from your wp-config.php.
How to resolve the error “1203 SQLSTATE: 42000 (ER_TOO_MANY_USER_CONNECTIONS)”? This depends on what MySQL server you are using .
max_connections = 250 Setting the max_connections too high will cause MySQL server to crash with an “Out of memory” error. Choose this value carefully depending on the RAM for your MySQL server VM.
How do I resolve a White Screen/Blank page? If you see a White Screen or a blank page when you access your website, the cause could either be plugin or theme related issue. Try to isolate the theme or plugin causing this issue. Check out the step by step guide here.
How do I resolve a Memory Size Exhausted error ? The default limit is 128MB. You can increase the Memory limit either using:
memory_limit=256M Restart your websites.
I want to share feedback on a feature or documentation for Azure Websites You can share your feedback about additional/missing documentation or new/existing features with our engineering team on User voice Related Links WordPress Troubleshooting Guide WordPress Support