Enable Php Intl In Nginx
What is Php Intl?
First thing we should discuss is what is Php Intl. PHP Internationalization or Intl is a set of PHP extensions providing APIs needed to support the use of many international standards such as Unicode, ISO-8859-1, Date/Time and Locale. This makes it a really useful tool to develop internationalized applications. The core International library that ships with PHP 5.3 and up is offered as an ext/intl extension.
How Does The Extensions Works?
The PHP Intl extension ships with a few basic capabilities that are useful for internationalizing applications. It ships with over 1400 locales and provides functions to convert strings from one locale to another. It also provides a set of basic functions for dealing with dates and timestamps in different parts of the world and create localized calendar systems. Additionally, it provides several collation functions that can be used to customize the ordering of strings in different languages.
How To Install The Php Intl Extension?
The best way to install the Php Intl extension is to use the PECL installation tool. This will enable you to easily install the extension without having to manually download and install the necessary libraries. For example, to install the extension on a Linux server, you can use the following command:
pecl install intl
How To Enable Php Intl In Nginx?
Once the extension has been installed, we need to enable it for use by Nginx. To enable Php Intl in Nginx, we have to add the following parameters to the Nginx configuration file:
location ~ .php$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
# Add this line
fastcgi_param INT_ENABLE 1;
}
Adding The Extension To The Php Config File
In order for the extension to be fully functional we also have to configure the php.ini file. We need to add the following line to the php.ini configuration file:
extension=intl.so
Testing The Extension
Once we have enabled the extension and reloaded the Nginx service we can proceed to check if it is working correctly. This can be done by adding the following lines to a PHP file and running it through Nginx:
if (extension_loaded('intl'))
echo 'Intl Extension Is Installed And Working';
Conclusion
The Intl extension is a great tool that makes it easier to develop international applications. It’s easy to install and configure but can require some knowledge to get the most out of it. But once it is set up, you can enjoy all the benefits it has to offer.
FAQs
Q: How to enable Php Intl in Nginx?
A: You can enable Php Intl in Nginx by adding the following parameters to the Nginx configuration file:
location ~ .php$ {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
# Add this line
fastcgi_param INT_ENABLE 1;
}
Q: How to test the Php Intl extension?
A: You can test the Php Intl extension by adding the following line to a PHP file and running it through Nginx:
if (extension_loaded('intl'))
echo 'Intl Extension Is Installed And Working';
Thank you for reading this article. Please read other articles as well.
Related Posts:
- Install Nginx Ubuntu 16.04 For Odoo Install Nginx Ubuntu 16.04 For Odoo Install Ubuntu Server 16.04 Before we can install Nginx for Odoo we need to install Ubuntu 16.04 on our server. Ubunutu 16.04 is still…
- Nginx More Than 4 Config Nginx More Than 4 Config Basics of Nginx Nginx is a powerful, open source web server. It is designed to be both efficient and secure. It is used to animate…
- Googlec Cloud Hosting Nginx Caching Proxy Google Cloud Hosting Nginx Caching Proxy What is Nginx? Nginx is an open source web server typically used to serve high-traffic websites. It offers a powerful set of features and…
- Nginx And Apache Together Centos Nginx and Apache Together in Centos Overview A popular choice for websites is using the powerful combination of Nginx and Apache together. The two web servers are both reliable and…
- Nginx Stream Port Forwarding With Domain Nginx Stream Port Forwarding With Domain Introduction Port Forwarding is usually used to allow traffic from the Internet to reach the internal network. To achieve this, port forward requires router…
- Nginx 2019 Beginner To Advanced Nginx 2019 Beginner To Advanced What is Nginx? Nginx (pronounced ‘Engine-X’) is an open source web server and a reverse proxy server for HTTP, SMTP, POP3 and IMAP. It was…
- Redirect Http To Https Nginx Redirect HTTP to HTTPS Nginx Why Should You Redirect HTTP to HTTPS Nginx? Many website owners are opting to use encrypted connections when delivering content to their visitors as a…
- Setup Wordpress With Memcached And Nginx Setup Wordpress With Memcached and Nginx Installing Memcached Memcached is a distributed in-memory caching system used to speed up web applications such as WordPress. It stores data in memory and…
- Run Bash From Nginx Config Run Bash From Nginx Config What is Nginx? Nginx is a web server that is free and open source. It is known for its high performance on static content and…
- Wordpress Nginx Ubuntu 18.04 Wordpress Nginx Ubuntu 18.04 Overview WordPress is a popular web software used by millions of people around the world. It allows users to easily create and manage websites without the…
- Nginx 1.10.3 Vs 1.3.0 Nginx 1.10.3 Vs 1.3.0 Overview of Nginx Nginx is a web server software package developed to run high-performance web applications and services. It is one of the most popular web…
- Nginx Tcp Multiple Port Forwarding Nginx Tcp Multiple Port Forwarding What is TCP Port Forwarding? TCP port forwarding is a network action that enables a computer to redirect communications that are normally sent over the…
- Install Nginx Windows Php-Fpm Install Nginx Windows Php-Fpm Nginx is a web server that is known for its high performance and low resource usage. It is commonly used to serve static content, reverse proxy…
- Nginx Access To Xmlhttprequest At Nginx Access To Xmlhttprequest At What is Nginx? Nginx is an open source web server and proxy server software that is designed for both high-performance web applications and for scalability.…
- Webmin Module For Nginx Web Server Webmin Module For Nginx Web Server Introduction to the Nginx Web Server Nginx is an open source web server and reverse proxy that offers powerful performance in a lightweight package.…
- Nginx Fancy Index Sort Rule Nginx Fancy Index Sort Rule What is Nginx Fancy Index? Nginx Fancy Index is an extension of the popular web server Nginx, which helps provide a clean and organized directory…
- Nginx Conf Sample Using Cache Nginx Conf Sample Using Cache Introduction Caching is an essential technique for website performance optimization. It helps to reduce server workload, enable scalability and serve contents faster. One of the…
- Using Helm To Install Nginx Ingress Using Helm To Install Nginx Ingress What is Helm? Helm is an open-source Kubernetes package manager. It is used to install and manage applications on Kubernetes clusters. Helm works with…
- Install Nginx On Centos 6 Install Nginx on CentOS 6 What is Nginx? Nginx is a web server and a reverse proxy server for HTTP, HTTPS, SMTP, POP3 and IMAP protocols, with a strong focus…
- How To Set Up Nginx Loadbalancer Ubuntu How To Set Up Nginx Loadbalancer Ubuntu Introduction to Nginx Loadbalancer Nginx Loadbalancer is a web application that lets you easily set up load balancing for your website. It is…
- Nginx Proxy_Pass Post Request Nginx Proxy_Pass Post Request What Is an Nginx Proxy_Pass Post Request? A Nginx Proxy_Pass Post request is a particular type of web request that allows a web server to forward…
- Docker Workspace See Log Nginx Docker Workspace See Log Nginx Overview Docker containers enable workflows to be created more efficiently, as software can be quickly and easily configured, tested and deployed. This can save valuable…
- How To Install Certificate Chain Nginx How To Install Certificate Chain Nginx What Is Nginx? Nginx is a web server that is open-source and free to use. It is efficient and high-performance, and is usually used…
- Install Webmin Plugin Nginx Ubuntu Install Webmin Plugin Nginx Ubuntu What is Nginx? Nginx is a web server that runs on the Linux operating system. It is a popular web server software and can handle…
- Start Nginx Service Centos 7 Start Nginx Service Centos 7 Before You Start: Server and Requirements If you are running a website or a web application on Centos 7, chances are you will be using…
- Where Default Root Folder Nginx Where Default Root Folder Nginx? What Is Nginx Nginx is an open source web server designed for high concurrency, performance and low memory consumption. The official website defines it as…
- Install Phpmyadmin Nginx Ubuntu 16.04 Php 7 Install Phpmyadmin Nginx Ubuntu 16.04 Php 7 Introduction to PhpMyAdmin PhpMyAdmin is a web-based tool that enables the users to manage their MySQL databases. It also provides a graphical interface…
- Install Laravel Nginx Ubuntu 18.04 Install Laravel Nginx on Ubuntu 18.04 Introduction In this tutorial, we will look at how to install Laravel with Nginx on an Ubuntu 18.04 server. Laravel is a powerful PHP…
- What Is Reverse Proxy Nginx What Is Reverse Proxy Nginx? What is Nginx? Nginx is a free, open-source web server software developed by Igor Sysoev since 2002. It gained immense popularity due to its ability…
- Nginx Php-Fpm Php Stack Overflow Articel Nginx Php-Fpm Php Stack Overflow Articel What Is Nginx? Nginx (pronounced engine-x) is an open source web server and reverse proxy software that is popular for its high performance and…