![]() ![]() Our admins are available 24/7 and will start to work on your request immediately. If you do not want to do this alone, sign up for one of our NVMe VPS plans and submit a support ticket. You successfully installed and enabled OPcache on Ubuntu 22.04. Then go ahead and save the file and restart the NGINX and php-fpm services to apply the changes. nano /etc/php/8.1/fpm/php.iniĪnd change the following lines for the best performance. Then you can enable the Opcache extension in the php.ini file and open the php.ini file with your favorite editor. To install and enable the Opcache PHP module on your server running with Nginx.įirst, you will install the Opcache extension with the following command: apt-get install php-opcache php-fpm -y Opcache.jit_blacklist_side_trace => 8 => 8 Opcache.jit_blacklist_root_trace => 16 => 16 Opcache.interned_strings_buffer => 8 => 8 Opcache.force_restart_timeout => 180 => 180 Opcache.file_cache_consistency_checks => On => On You can now verify the PHP OPcache installation with the following command: php -i | grep opcache Save and close the file, then restart the Apache service to apply the changes: systemctl restart apache2 Uncomment the following lines: opcache.enable=1 Next, you will need to enable the PHP OPcache by editing php.ini file. With Zend OPcache v8.1.2-1ubuntu2.13, Copyright (c), by Zend Technologies Zend Engine v4.1.2, Copyright (c) Zend Technologies You should get the following output: PHP 8.1.2-1ubuntu2.13 (cli) (built: 14:01:49) (NTS) Once all the packages are installed, verify the PHP version with the following command: php -version You can install them with the following command: apt-get install apache2 libapache2-mod-php php php-cli php-opcache php-mysql php-zip php-gd php-mbstring php-curl php-xml -y In this section, we will show you how to install PHP OPcache and enable it for the Apache web server.įirst, you will need to install Apache, PHP, and other PHP extensions on your server. Install and Configure PHP OPcache with Apache You can do this by running the following commands: apt-get update -yĪpt-get upgrade -y Step 2. ![]() Additionally, replace ‘root’ with the username of the admin account if necessary.īefore starting, you have to make sure that all Ubuntu OS packages installed on the server are up to date. You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Log in to the Server & Update the Server OS Packagesįirst, log in to your Ubuntu 22.04 server via SSH as the root user: ssh -p Port_number User privileges: root or non-root user with sudo privileges.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |