Azure / wordpress-linux-appservice

MIT License
96 stars 65 forks source link

impossible to reload nginx standalone or with supervisor after installation of php intl on stack wordpress 8.3 #153

Closed dho79 closed 3 weeks ago

dho79 commented 3 weeks ago

Hello I cant load extension intl in nginx/php-fpm on stack Wordpress php 8.3

Installation via /home/dev/startup.sh apk add icu-dev docker-php-ext-configure intl docker-php-ext-install intl docker-php-ext-enable intl /usr/sbin/nginx -s reload

command php -i gives the following output on intl module

intl

Internationalization support => enabled ICU version => 74.1 ICU Data version => 74.1 ICU TZData version => 2023c ICU Unicode version => 15.1

Directive => Local Value => Master Value intl.default_locale => no value => no value intl.error_level => 0 => 0 intl.use_exceptions => Off => Off

but nothing appears in phpinfo() on web site

even executing /usr/sbin/nginx -s reload nothing seems to be reloaded

when using supervisorctl to reload the program nginx or php-fpm error Error: .ini file does not include supervisorctl section

any idea?

ZubaeyrMSFT commented 3 weeks ago

Hello @dho79, I am summarizing the steps below to install intl extension. Please try them out once.

  1. Run this code only once from the SSH console (https://_\<appname>_.scm.azurewebsites.net/newui/webssh).

    apk add icu-dev && \
    docker-php-ext-configure intl && \
    docker-php-ext-install intl && \
    docker-php-ext-enable intl
  2. Now copy the intl.so & docker-php-ext-intl.ini file to persistent storage (/home). Run this code from the SSH console

mkdir /home/intl-ext
cp /usr/local/etc/php/conf.d/docker-php-ext-intl.ini /home/intl-ext/docker-php-ext-intl.ini
cp /usr/local/lib/php/extensions/no-debug-non-zts-20220829/intl.so /home/intl-ext/intl.so
  1. Add below code in /home/dev/startup.sh file.
apk add icu-dev
cp /home/intl-ext/docker-php-ext-intl.ini /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
cp /home/intl-ext/intl.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/intl.so
supervisorctl restart php-fpm
  1. Now try to execute the startup.sh script from SSH console and see if there are any errors.
cd /home/dev
./startup.sh
  1. If you see any errors related to supervisord process, then replace the code in /home/dev/startup.sh file with below one. Otherwise, ignore this step
apk add icu-dev
cp /home/intl-ext/docker-php-ext-intl.ini /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
cp /home/intl-ext/intl.so /usr/local/lib/php/extensions/no-debug-non-zts-20220829/intl.so
kill $(ps aux | grep 'php-fpm' | awk '{print $1}') 2> /dev/null
  1. Now Restart your App Service and check if the extension is enabled using phpinfo file. To create phpinfo file run the below commands from SSH console.
cd /home/site/wwwroot/
echo "<?php phpinfo();" > phpinfo.php
  1. Don't forget to delete the phpinfo.php file immediately after validating the extension.
    rm /home/site/wwwroot/phpinfo.php
dho79 commented 3 weeks ago

for information ==>supervisorctl restart php-fpm gives this output Error: .ini file does not include supervisorctl section For help, use /usr/bin/supervisorctl -h

with killing the process it works...but it is a bit violent! kill $(ps aux | grep 'php-fpm' | awk '{print $1}') 2> /dev/null

folder for int.so is /usr/local/lib/php/extensions/no-debug-non-zts-20230831/intl.so !

can this module be included in the image as it recommended for wordpress ??

Thanks!

ZubaeyrMSFT commented 3 weeks ago

Thanks, I have noted this down. We will evaluate internally to see if we should add it by default.