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:
if we redirected our domain gitlab.naszadomena.pl to the server's IP address, the login page should be displayed 8
Installing the Webmin panel on Ubuntu 22.04
Multimedia installation on Ubuntu combine Kodi 18.04
The following tutorial describes how to install Snapd package manager on AlamaLinux 8
Chmod how to understand values