@Yash Thanks for reaching here! If I have understood right you want to install PHP extensions on the WordPress Linux App Services.
If so please follow below steps:
- Open an SSH session using WebSSH from the Azure portal. Find out the PHP version of your WordPress image using the below command.
php -v
2. Install soap extension for PHP. Note: Depending on the version of the PHP, the name of the package needs to be updated accordingly. Additionally, you can use the Alpine Linux Packages dashboard to search for your required PHP extensions. You can make use of wildcards (* and ?) in the search.
apk update
apk add php8-soap
3. For PHP 8, the extensions will be installed under /usr/lib/php8/modules/. If you are not able to find it, you can make use of find command to locate the extension file.
cd /
find . -name 'soap.so'
4. Now that the extension is installed, you need to create an ext directory under /home/site/ and copy the extension file to it. This is because changes made outside /home path are non-persistent in nature and will be reset to the default state when the container is restarted.
mkdir -p /home/site/ext
cp /usr/lib/php8/modules/soap.so /home/site/ext/soap.so
5. Then we need to create a extensions.ini file under /home/site/ini directory and add the extension configuration to it.
mkdir -p /home/site/ini
echo 'extension=/home/site/ext/soap.so' >> /home/site/ini/extensions.ini
6. Go to your App Service in Azure Portal and add the following Application Settings.
You will find Application Settings under Settings -> Configurations blade. Once the below settings are added, click on save. This will restart your Web App and new changes should be reflected.
Application setting name: PHP_INI_SCAN_DIR
Value: /usr/local/etc/php/conf.d:/home/site/ini
Reference document: https://github.com/Azure/wordpress-linux-appservice/blob/main/WordPress/wordpress_adding_php_extensions.md
Also see: https://learn.microsoft.com/en-us/azure/app-service/configure-language-php?pivots=platform-linux#enable-php-extensions
Please let us know if further query or issue remains.