How to Install PHP Redis Extension in Ubuntu 22.04?
Hey Folks,
In this tutorial, we will go over the demonstration of how to install php redis extension in ubuntu. This article will give you a simple example of ubuntu php install php ext-redis extension. This article goes in detailed on install php redis extension ubuntu 20.04. Here you will learn install php redis extension ubuntu.
We can install php redis extension using php-redis library. i will give you following list of commands to install php redis extension in ubuntu 22.10, ubuntu 22.04, ubuntu 21.10, ubuntu 21.04, ubuntu 20.04, ubuntu 18.04 and ubuntu 16.04 server.
Install Redis Server
You need to run both commands one by one:
sudo apt install redis-server
Install php-redis Extension:
Solution:
You need to run both commands one by one:
sudo apt-get install php-redis
Solution for PHP 8.3
You need to run both command one by one:
sudo apt-get install php8.3-redis
Solution for PHP 8.2
You need to run both command one by one:
sudo apt-get install php8.2-redis
Solution for PHP 8.1
You need to run both command one by one:
sudo apt-get install php8.1-redis
Solution for PHP 8.0
You need to run both command one by one:
sudo apt-get install php8.0-redis
Solution for PHP 7.4
You need to run both command one by one:
sudo apt-get install php7.4-redis
Solution for PHP 7.3
You need to run both command one by one:
sudo apt-get install php7.3-redis
Solution for PHP 7.2
You need to run both command one by one:
sudo apt-get install php7.2-redis
Restart Apache Server:
Now, restart apache2 server using following command:
sudo service apache2 restart
Check php-redis Extension Installed:
Here, we will run following command to check extension is installed or not:
php -m | grep -i redis
You can check if the redis extension is enabled by creating a PHP file with the following content and accessing it through your web browser:
<?php
phpinfo();
?>
Look for a section that mentions "redis." If you see it, the extension is successfully installed and enabled.
Please note that the package name (php-redis) and web server commands may vary slightly depending on your PHP version and web server. If there are any changes in Ubuntu 22.04, make sure to check the official documentation or community resources for the most up-to-date information.
I hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- How to Install PHP 8.3 with Nginx on Ubuntu 22.04?
- How to Upgrade PHP Version from 8.2 to 8.3 in Ubuntu?
- How to Install PHP 8.3 on Ubuntu 22.04?
- How to Install Node JS and NPM Ubuntu 22.04 Linux?
- How to Install SketchUp 3D on Ubuntu 22.04 Linux?
- How to install GCC on Ubuntu 22.04 Terminal?
- How to Uninstall NGINX in Ubuntu 22.04?
- How to Enable ufw Firewall in Ubuntu 22.04?
- How to Restart Apache2 in Ubuntu 22.04?
- How to Check MySQL Version in Ubuntu?
- How to Upgrade from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS?
- How to Upgrade PHP Version from 8.1 to 8.2 in Ubuntu?
- How to Increase max_input_vars in PHP Ubuntu?