Blog

How to Install PHP modules

$ touch /var/www/temp/info.php
<?php

echo phpinfo();

?>
  1. Update Package List: First, make sure your package list is up to date. Open a terminal or connect to your server via SSH and run:
sudo apt-get update
  1. Install PHP Intl Extension: Install the intl extension for your specific PHP version by running:
sudo apt-get install php8.2-intl
  1. Restart PHP-FPM and Nginx: After installation, you'll need to restart the PHP-FPM service for the changes to take effect. It's also a good idea to restart Nginx:
sudo systemctl restart php8.2-fpm
sudo systemctl restart nginx

After installation and restarting the services, you can verify that the intl extension is loaded by creating a simple PHP file (e.g., info.php) containing <?php phpinfo(); ?> and viewing it in a web browser. This will show all loaded extensions and their configurations. Alternatively, you can run php -m | grep intl in the terminal to see if intl is listed among the loaded modules.

If the intl extension still doesn't appear, ensure that you've installed it for the correct PHP version and that the extension is enabled in the PHP configuration (php.ini). In some cases, you might need to explicitly enable the extension by adding extension=intl to your php.ini file or by creating a symlink in the mods-available directory to the corresponding conf.d directory for your PHP version.

Want more insights?

Sign up for my newsletter.

I care about your data. Read my privacy policy.