Modifying php.ini settings on a HestiaCP VPS

Procédure

To change php.ini settings on HestiaCP, adjust the PHP-FPM version configuration linked to your site from the interface or via SSH, then restart the service. HestiaCP is an open-source hosting control panel that makes it easy to manage websites, databases, and server services. This procedure allows you to adapt your web applications' resources to their actual needs.

Steps

  1. Identify the PHP version assigned to the domain

    Log in to your HestiaCP panel, go to the WEB section, and click the domain to configure. Expand the Advanced options section to note the active version defined under the PHP-FPM backend template field (for example PHP-8_3 or the default value).

    Modifying php.ini settings on a HestiaCP VPS
  2. Modify PHP directives via the HestiaCP interface

    Click the server settings icon (the gear in the top right), scroll to the PHP-FPM service corresponding to your version, then open it. Change the desired fields, such as max_execution_time, memory_limit, post_max_size, or upload_max_filesize, then click Save.

    Modifying php.ini settings on a HestiaCP VPS
  3. Identify the path to the php.ini configuration file

    If you need to work from the command line or inspect the source file, view the paths shown in the PHP service configuration advanced options. The files are located on your server in the standardized tree (for example /etc/php/8.3/fpm/php.ini).

    Modifying php.ini settings on a HestiaCP VPS
  4. Create a backup of the file via SSH

    Connect to your server from the command line using the root account (for example ssh root@203.0.113.10). Before making any manual changes, create a backup copy of your configuration with the command cp /etc/php/8.3/fpm/php.ini /etc/php/8.3/fpm/php.ini.bak, adjusting the version number.

  5. Edit the php.ini file and test the syntax

    Open the configuration file with the text editor by running nano /etc/php/8.3/fpm/php.ini. Modify your settings, exit saving the changes with the Ctrl+X shortcut, then confirm with O, and finally check the file's integrity using the command php-fpm8.3 -t.

  6. Restart PHP-FPM and verify the values

    Apply your changes by restarting the service with systemctl restart php8.3-fpm. To make sure the changes are correctly taken into account, create a temporary file containing at the root of your website, view it in your browser, then delete it immediately after verification.

Common PHP directives and example values

Here are the php.ini settings most often adjusted to meet the requirements of CMSs and web scripts.

  • memory_limit (e.g. 256M or 512M) — defines the maximum amount of RAM a PHP script can allocate for its execution
  • upload_max_filesize (e.g. 64M or 128M) — limits the maximum allowed size for an individual file uploaded through a form
  • post_max_size (e.g. 64M or 128M) — determines the total maximum size of data sent by an HTTP POST request (must be greater than or equal to upload_max_filesize)
  • max_execution_time (e.g. 120 or 300) — sets the maximum duration in seconds allowed for a script to run before it is interrupted

Customization by domain pool and update risks

Understanding the levels of customization in HestiaCP helps avoid conflicts and the unintentional loss of settings.

  • Customization via the PHP-FPM pool — allows directives to be restricted to a single site without modifying the server's global php.ini
  • Risk of settings being overwritten — general configuration files can be reset or modified during a major update of the PHP system package

Frequently asked questions

Why aren't my changes in php.ini showing up on my site?

Check that you have modified the file corresponding to the PHP version used by your domain and that the appropriate PHP-FPM service has been restarted (e.g. systemctl restart php8.3-fpm).

Why do my imports keep failing despite increasing upload_max_filesize?

The post_max_size directive must always be equal to or greater than upload_max_filesize, otherwise file upload requests larger than that are rejected.

How do I fix a syntax error after editing the file over SSH?

Run php-fpm8.3 -t to identify the error line, or simply restore your backup with the command cp /etc/php/8.3/fpm/php.ini.bak /etc/php/8.3/fpm/php.ini before restarting the service.

A script still stops after 60 seconds despite a higher max_execution_time, why?

The front web server (Nginx or Apache) has its own timeout directives (such as proxy_read_timeout or Timeout) that can interrupt the connection before PHP.

Can different PHP versions be used for multiple domains on HestiaCP?

Yes, HestiaCP allows you to assign a distinct PHP-FPM backend template to each domain in its web profile's advanced options.

Useful links

help.lws.net/a/7958
Was this article helpful?

Yes

No

Read 2 times

Thank you! Feel free to ask questions about our documentation if you would like more information, and help us improve it.

Similar articles

A question about this article?

Ask the LWS team and the community. Answers are published after moderation.

Ask the LWS team and its community a question

GDPR: Controller: LWS-Ligne Web Services. Purpose: moderation and public publication of your question, possible notification of an answer. Legal basis: consent (Art. 6(1)(a) GDPR). Email retention: 90 days after notification, 12 months maximum without an answer. To exercise your rights, see the GDPR section of our Terms and Conditions.