I’ve been testing setting up WordPress on Linux as an Azure Web App. Checking and setting the PHP version has been quite a challenge. Here’s how I finally got it working.
I first set up a WordPress on Linux app in West US 2 using a P1v2 app service plan and a Basic database:
You’re supposed to be able to see and change the PHP version from the Azure app under Setting > Configuration > General Settings, but that didn’t show anything about PHP:
At this point, following this document, I checked the PHP version and learned that it is “DOCKER|appsvcorg/wordpress-alpine-php:0.72” (which makes no sense to me):
I confirmed this by removing the
--query parameter so I could see the entire configuration. The linuxFxVersion is is about halfway down in the results:
I found that I could set the PHP version using the command in the same document.
Note The show and set commands have different syntax. Show uses
--query linuxFxVersion where as set uses
--linux-fx-version (which must be lowercase). Thanks to RoderickBant74 for leading me through that confusion in this thread.
Now the show works as expected:
And the PHP version appears in the UI as well:
It would have saved a lot of time If that had been in the UI in the first place!
I suspect this is a misconfiguration in the WordPress image. Until that is fixed, use the command line to set PHP once, then you should be able to control it from the UI.
Update January 10, 2021
A Microsoft rep responded in two places regarding this issue. Be sure to review those replies:
As I noted in my November 20, 2020 comment on the Github issue:
Thank you for the referral to the WordPress on Azure Docker site, which I followed to its Github pages. For some reason, the critical “how to” .md files are not displayed in the Azure marketplace, but I learned enough to realize that I probably need to abandon this image. For example, they recommend against doing a major version upgrade to WordPress inside the container because they do not use persistent storage. Issues are not receiving much attention. The 0.8 branch was last updated two years ago. The 0.9 branch, updated 4 months ago, is not even listed in Docker. In fact, the entire https://github.com/Azure/app-service-quickstart-docker-images project, in spite of over 1 million downloads, seems almost dead. It’s surprising that such a popular project with is just allowed to languish, and that Microsoft would not offer an official option for hosting WordPress.
I’m not sure I ever understood whether changing the PHP version really loaded a new Docker image. However as noted, I didn’t feel that it would be wise to use an image that is not well maintained, and I was also concerned about the lack of persistent storage. I decided instead to create a new Ubuntu 20.04 virtual machine, this time based on an image from OpenLiteSpeed. Once I resolved a security concern, the image seems pretty good and easier to set up than Bitnami. The CyberPanel product from the same company looks promising as well.