🚀 How to Enable PHP 8.4-FPM in HestiaCP and Fix Potential Errors

Hello! :blush:

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.

:white_check_mark: How to Enable PHP 8.4 in HestiaCP

To make this new version available, follow these steps:

  1. Access the HestiaCP settings.
  2. Select PHP 8.4-FPM.
  3. Save the changes.

HestiaCP will automatically begin the installation process.

:warning: 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.

:hammer_and_wrench: Adjusting PHP 8.4-FPM Configuration

Edit the following configuration file:

:open_file_folder: 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  

:mag: 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.

:arrows_counterclockwise: 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.

:bulb: 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! :rocket:

4 Likes

This is the solution for existing PHP versions as well.
Add the missing lines in dummy.conf as described.

thank you!