Install PHP extensions for Laravel 13 on Ubuntu

Author
By Darío Rivera
Posted On in Laravel

In a previous article, we saw how to install PHP extensions in Ubuntu. In today's post, we will install all extensions required by Laravel 13. For the sake of this post, we will assume that you have an active LTS version of Ubuntu, in this we'll use 24.04 (Noble Numbat), and that you have previously installed PHP>=8.3.

Requirements

Laravel 13 requires the following extensions.

- PHP >= 8.3
- Ctype PHP Extension
- cURL PHP Extension
- DOM PHP Extension
- Fileinfo PHP Extension
- Filter PHP Extension
- Hash PHP Extension
- Mbstring PHP Extension
- OpenSSL PHP Extension
- PCRE PHP Extension
- PDO PHP Extension
- Session PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension

Ctype, Tokenizer, Fileinfo, Filte, Hash, Session, and PCRE extensions are usually part of php-common and/or enabled by default. DOM & XML are provided by php-xml.

If your application will use locales other than en, ensure the ext-intl PHP extension is installed and configured on your server as well.

Laravel uses SQLite by default, making it an excellent choice for starting a project without database overhead. SQLite support is provided by php-sqlite3.

Installation for PHP 8.3

To install these extensions just run the following command.

sudo apt-get install php8.3-common \
   zip unzip php8.3-zip \
   php8.3-mbstring php8.3-xml \
   openssl php8.3-curl php8.4-sqlite3

For locales other than en.

sudo apt-get install php8.3-intl

For using PHP with MySQL.

sudo apt-get install php8.3-mysql

For using PHP with Redis.

sudo apt-get install php8.3-redis

Installation for PHP 8.4

For PHP 8.4 you can use the following command.

sudo apt-get install php8.4-common \
   zip unzip php8.4-zip \
   php8.4-mbstring php8.4-xml \
   openssl php8.4-curl php8.4-sqlite3

For locales other than en.

sudo apt-get install php8.4-intl

For using PHP with MySQL.

sudo apt-get install php8.4-mysql

For using PHP with Redis.

sudo apt-get install php8.4-redis

Installation for PHP 8.5

For PHP 8.5 you can use the following command.

sudo apt-get install php8.5-common \
   zip unzip php8.5-zip \
   php8.5-mbstring php8.5-xml \
   openssl php8.5-curl php8.5-sqlite3

For locales other than en.

sudo apt-get install php8.5-intl

For using PHP with MySQL.

sudo apt-get install php8.5-mysql

For using PHP with Redis.

sudo apt-get install php8.5-redis

Acerca de Darío Rivera

Author

Application Architect at Elentra Corp . Quality developer and passionate learner with 10+ years of experience in web technologies. Creator of EasyHttp , an standard way to consume HTTP Clients.

LinkedIn Twitter Instagram

Sólo aquellos que han alcanzado el éxito saben que siempre estuvo a un paso del momento en que pensaron renunciar.