Installing and configuring PHP Opcache on Ubuntu 20.04 For Apache and Nginx
The guide below describes how to install PHP Opcache on Ubuntu 20.04 For both Apache and Nginx.
Made in seconds.
For Apache systems
We start the terminal and install Opcache:
1 | apt-get install php-opcache -y |
Edit the php.ini file
1 | nano /etc/php/7.4/apache2/php.ini |
and add at the end:
1 2 3 4 | opcache.enable=1 opcache.memory_consumption=128 opcache.max_accelerated_files=3000 opcache.revalidate_freq=200 |
We restart the Apache server:
1 | systemctl restart apache2 |
In the case of Nginx the procedure is very similar:
Installation:
1 | apt-get install php-opcache php-fpm -y |
Edit the php.ini file
1 | nano /etc/php/7.4/fpm/php.ini |
We add at the end of the file:
1 2 3 4 | opcache.enable=1 opcache.memory_consumption=128 opcache.max_accelerated_files=3000 opcache.revalidate_freq=200 |
And we overload services
1 | systemctl restart nginx |
1 | systemctl restart php7.4-fpm |
Related entries:
gconf-service gconf-service-backend gconf2-common libappindicator1 libc++1 libc++1-9 libc++abi1-9 libdbusmenu-gtk4 libgail-common libgail18 libgconf-2-4 libgtk2.0-0 libgtk2.0-bin libgtk2.0-commonAll-in-one voice and text chat for gamers
All-in-one voice and text chat for gamers that's free 22.04
Things to do after installing Ubuntu 19.10
Solving the problem of no matching host key type found. Their offer: ssh-rsa,ssh-dss
Convert Video to Audio files in Ubuntu 20.04
Error: username does not appear in the file sudoers. This incident will be reported.





