Hello!
In the latest HestiaCP update, support for PHP 8.4-FPM has been introduced. You can now enable this version directly from the control panel.
How to Enable PHP 8.4 in HestiaCP
To make this new version available, follow these steps:
- Access the HestiaCP settings.
- Select PHP 8.4-FPM.
- Save the changes.
HestiaCP will automatically begin the installation process.
Possible Error After Installation
After installation, you might encounter an issue preventing PHP 8.4 from starting correctly. If this happens, follow the steps below to fix it.
Adjusting PHP 8.4-FPM Configuration
Edit the following configuration file:
File to edit:
/etc/php/8.4/fpm/pool.d/dummy.conf
Add the following lines at the end of the file:
pm = ondemand
pm.max_children = 4
pm.max_requests = 4000
pm.process_idle_timeout = 10s
What Do These Settings Do?
- pm = ondemand
Defines the PHP-FPM process management mode. The ondemand mode starts processes only when a request is received, reducing server resource consumption. - pm.max_children = 4
Sets the maximum number of child processes that PHP-FPM can create. In this case, up to 4 PHP processes can run simultaneously. - pm.max_requests = 4000
Specifies how many requests each process can handle before being restarted. This helps prevent memory leaks and other performance issues. - pm.process_idle_timeout = 10s
Defines how long an idle process can remain before being terminated. If a process is inactive for more than 10 seconds, it will be automatically shut down to save resources.
Finalizing the Configuration
After saving the changes, restart PHP 8.4 directly from the HestiaCP panel. This should fix the issue and ensure PHP runs correctly.
If the problem persists, check the PHP-FPM error logs to identify potential causes and necessary adjustments.
Tip: To view the logs, use the following command:
journalctl -u php8.4-fpm --no-pager | tail -n 50
This will display the last 50 lines of the PHP-FPM execution log, helping you diagnose any issues.
I hope this helps!