PHP limits in ISPmanager: max_execution_time, upload_max_filesize, post_max_size

These three PHP settings most often get in the way of database imports, large uploads and long CMS operations. They are set per site, in the .htaccess file in the site folder.

SettingWhat it limitsExample
max_execution_timehow many seconds one script may run300
upload_max_filesizethe maximum size of one uploaded file256M
post_max_sizethe maximum size of all form data; must be at least upload_max_filesize256M

How to change

  1. Open "File manager" → www → the site folder.
  2. If there is no .htaccess, create it.
  3. Click the three dots on .htaccess and open the file.
Site folder in the file manager
Site folder in the file manager
File menu
File menu
  1. Add the lines you need:
php_value max_execution_time 300
php_value upload_max_filesize 256M
php_value post_max_size 256M
  1. Save the file.
PHP limits in .htaccess
PHP limits in .htaccess

The new values work at once, no restart needed.

This works in LSAPI and Apache module modes. For FastCGI (Nginx + PHP-FPM) put the same settings in .user.ini in the site folder, as upload_max_filesize = 256M. It applies within 5 minutes.

Common mistakes

  • Only upload_max_filesize was raised and a large file still fails: raise post_max_size too.
  • The .htaccess lines have no effect: the site runs in FastCGI mode, use .user.ini.
  • Error 500 after editing: a typo in .htaccess; remove the added lines and check the spelling.

Site PHP mode: PHP version and mode.

Questions and answers
Add php_value upload_max_filesize 256M and php_value post_max_size 256M to .htaccess.
post_max_size limits the whole form request; upload_max_filesize limits a single file. post_max_size must be at least as large.
The site runs in FastCGI (Nginx + PHP-FPM) mode. Put the setting in .user.ini instead.
Create a temporary file that calls phpinfo() and open it in the browser. Delete the file afterwards.