@cali_green
To install the Redis extension for PHP, follow these steps:
- Make sure you have the Redis server installed on your system. You can download and install Redis from the official website.
- Install the PHP Redis extension using PECL (PHP Extension Community Library). Run the following command in your terminal:
- Once the installation is complete, enable the Redis extension in your PHP configuration. To do this, open your PHP configuration file (php.ini) and add the following line:
- Save the changes and restart your web server for the changes to take effect. You can restart Apache using the following command:
1
|
sudo service apache2 restart
|
- To verify that the Redis extension is installed and enabled, you can create a phpinfo() file with the following content:
1
2
3
|
<?php
phpinfo();
?>
|
Save the file as phpinfo.php in your web server's document root directory, and access it in your browser (http://localhost/phpinfo.php). Search for "redis" in the output to confirm that the extension is installed and enabled.
That's it! You have now successfully installed the Redis extension for PHP on your system.