How to fix the error on Linux based azure app service? error: qTranslate‑XT: Error: The value set for option "Date / Time Conversion" cannot be used. Class not found: `IntlDateFormatter` likely due to missing PHP extension: `Intl`.

Chinmay Naik 0 Reputation points
2023-06-12T13:06:39.3133333+00:00

I have an azure app service (Linux) for a WordPress site and it requires an extension to be enabled.

based on the error below, can someone help me with enabling the extension on the azure app service (Linux, WordPress deployed using Docker container)

qTranslate‑XT(WordPress Plugin) : Error: The value set for option "Date / Time Conversion" cannot be used. Class not found: IntlDateFormatter likely due to missing PHP extension: Intl.

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

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 14,180 Reputation points MVP
    2023-06-12T20:04:31.1433333+00:00

    PHP extension intl is missing.

    This extension provides capabilities for internationalization (i18n) in PHP applications.

    (Reference Link: https://azureossd.github.io/php/)

    In an Azure App Service, you can add PHP extensions in the following ways:

    The Azure App Service on Linux supports PHP as a built-in runtime stack. The platform automatically updates your application to the latest patch version of PHP available. However, the extensions that are available depend on the PHP version and configuration provided by Azure. Unfortunately, it is not currently possible to add additional PHP extensions to the built-in PHP runtime in Azure App Service on Linux. This could be a limitation if the intl extension is not included in the PHP version you are using​.

    If you are deploying your WordPress application using a Docker container, you have the ability to customize the PHP runtime, including the installed extensions. To do this, you would need to create a custom Docker image that includes the PHP runtime with the intl extension enabled.

    FROM php:7.4-apache
    
    # Install the intl extension
    RUN apt-get update && apt-get install -y \
        libicu-dev \
        && docker-php-ext-configure intl \
        && docker-php-ext-install intl
    

    This Dockerfile starts from the php:7.4-apache base image, installs the libicu-dev package which is required for the intl extension, and then installs the intl extension itself.

    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.