Install PHP extensions for Laravel 8 on Debian
In a previous post we saw how to install PHP extensions in Debian. In today's post, we will install all those extensions required in Laravel 8. For the purpose of this post, we are going to assume that you have the latest version of Debian, which in this case is 10 (Buster) and that you have already installed PHP 7.4.
Requirements
The following extensions are required in Laravel 8.
- PHP >= 7.3
- BCMath PHP Extension
- Ctype PHP Extension
- Fileinfo PHP extension
- JSON PHP Extension
- Mbstring PHP Extension
- OpenSSL PHP Extension
- PDO PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
Installation
To install these extensions just run the following command.
sudo apt-get install php7.4-intl php7.4-bcmath php7.4-common php7.4-json php7.4-mbstring openssl php7.4-xml
The Tokenizer, PDO, and fileinfo extensions are part of php-common. Other extensions that you may need if you consume web services are soap and curl.
sudo apt-get install php7.4-soap php7.4-curl
If you are going to use MySQL as your database, you will also need to install the following extension.
sudo apt-get install php7.4-mysql
And if you plan to use Redis for queues, you will need to install php-redis.
sudo apt-get install php-redis
Finally, if you are developing and your redis server is on your same machine, you will need to install the redis server.
sudo apt-get install redis-server