Earlier APC extension was used, but it has been replaced by APCu nowadays. The previous version used to be known by the APC in PHP 5.5, it used to provide opcode and object caching functionality. However, as the time pass by developer created APCu which is more flexible and robust.
In order to install APCu extension in PHP 7.0, 7.1, 7.2 +, you must log inside your server as a root user using SSH access. Hit below commands in your terminal.
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
# Replace X with your php version number
sudo pecl7.X-sp install apcu
It will ask the given below question, hit enter.
# Hit Enter in response to this question
Enable internal debugging in APCu [no] :
As soon as you entered the above command, it will start processing once it is finished with the process. Then create a file to keep the configuration for the extension, finally run the below command as a root user to restart the PHP.
# Replace php7.X-sp => X with your PHP version
sudo bash -c "echo extension=apcu.so > /etc/php7.X-sp/conf.d/apcu.ini"
# Replace php7.X-sp => X with your PHP version
sudo service php7.X-fpm-sp restart
APCu creates some problems if you are using PHP 7+ versions. To provide full backward compatibility with APCu with PHP 7+, we should install APCu Backwards Compatibility extension.
Use the below command to make sure whether the APCu PHP extension is installed precisely.
phpX.Y-sp -i | grep apcu
Following will be the output of above cmd:
# Replace php7.X-sp => X with your PHP version
Additional .ini files parsed => /etc/phpX.Y-sp/conf.d/apcu.ini,
apcu
Type the below command in terminal, to uninstall the PHP APCu extension.
# Replace php7.X-sp => X with your PHP version
sudo rm /etc/phpX.Y-sp/conf.d/apcu.ini
sudo peclX.Y-sp uninstall apcu
Finally, don’t forget to restart the PHP-FPM:
sudo service phpX.Y-fpm-sp restart
If you want to learn how to get the current route's name, component pathname or…
React show and hide example. In this tutorial, we will show you how to step…
Tabs are one of the best UI elements for displaying multiple contents in a single…
In this tutorial, we will learn how to create a toast notification component in the…
Bootstrap offers tons of custom UI solutions. On top of that, it is easy to…
React js counter using the useReducer hook example. In this post, we will learn how…