azure web app - wordpress

Yash 1 Reputation point
2023-04-08T11:32:05.0133333+00:00

Hello i am trying to deploy WordPress website and 1 of my requirements is to have php addons. like php lnl to support multilanguage after installing the webapp, seems like its unable to install anything inside. otherwise i am doing it wrong, MicrosoftTeams-image

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
{count} votes

2 answers

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2023-04-10T14:03:29.15+00:00

    @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:

    1. 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.

    1 person found this answer helpful.
    0 comments No comments

  2. A. Nikolopoulos 0 Reputation points
    2024-03-20T08:40:36.4433333+00:00

    I don't know if that worked for the OP but this doesn't work. The Wordpress Web App has no retention whatsoever. I have tried everything from startup scripts -so the intl module I want be installed on startup- to everything on every guide or post there is. Does anyone have any other solution?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.