AdminsForum

CyberPanel PHP & LSPHP Guides

Guide How to Change PHP Settings in CyberPanel: Upload Size, Memory Limit and php.ini

Started by JAY 0 replies 108 views
1JAY
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
#1
How to Change PHP Settings in CyberPanel: Upload Size, Memory Limit and php.ini

"The uploaded file exceeds the upload_max_filesize directive", "Allowed memory size exhausted", a backup import that times out: these are all PHP limits, and in CyberPanel you change them per PHP version.

Step 1: Know your site's PHP version
Settings belong to a PHP version, not to a website. If your site runs PHP 8.3, edit PHP 8.3. You can see and change a site's version under Websites.

Step 2: Change the basic settings
Open Server > PHP Configs. The Basic Settings tab covers the values people change most:
[Image: attachment.php?aid=556]

Select the PHP Version. On a fresh install the defaults are small: memory_limit 128M, max_execution_time 30, upload_max_filesize 2M, post_max_size 8M and max_input_time 60. That 2 MB upload limit is why so many first uploads fail. Adjust:
  • upload_max_filesize: the biggest single file you can upload. For WordPress media and plugin uploads,
    Code:
    64M
    or
    Code:
    128M
    is plenty.
  • post_max_size: the whole form submission. Keep it equal to or bigger than upload_max_filesize, or big uploads still fail.
  • memory_limit: memory one PHP script may use.
    Code:
    256M
    suits most WordPress sites; page builders and WooCommerce may want
    Code:
    512M
    .
  • max_execution_time and max_input_time (seconds): raise to
    Code:
    300
    for big imports. Don't leave huge values on a busy server.
  • display_errors: keep Off on live sites, or visitors see paths and errors.
  • file_uploads On, allow_url_fopen usually On, allow_url_include always Off (it's a security risk).
Click Save Changes, then Restart PHP. Without the restart, nothing changes.

Step 3: The full php.ini (Advanced Editor)
The Advanced Editor tab opens the complete php.ini for the selected version, for settings that aren't on the basic tab (for example
Code:
max_input_vars
, which page builders and big menus often need at
Code:
5000
). Edit, Save Changes, Restart PHP.

The same file on disk, for PHP 8.3 on Ubuntu:
Code:
/usr/local/lsws/lsphp83/etc/php/8.3/litespeed/php.ini
After editing by hand:
Code:
systemctl restart lsws
.

Step 4: Check the new value
Code:
/usr/local/lsws/lsphp83/bin/php -i | grep -E 'upload_max_filesize|post_max_size|memory_limit'
For what the website really sees, check WordPress Tools > Site Health > Info > Server, or a temporary phpinfo file (delete it afterwards).

Still limited after changing it?
  • Wrong PHP version edited: check the site's version again.
  • PHP not restarted: click Restart PHP or restart lsws.
  • A .htaccess or .user.ini override in the site folder sets a lower value. Search for it:
    Code:
    grep -ri 'upload_max\|memory_limit' /home/example.com/public_html/.htaccess /home/example.com/public_html/.user.ini 2>/dev/null
  • WordPress' own limit:
    Code:
    WP_MEMORY_LIMIT
    in wp-config.php can be lower than PHP's memory_limit.
  • Upload still fails above ~100 MB behind Cloudflare: Cloudflare's free plan limits request size to 100 MB.
Missing an extension rather than a limit? See how to install PHP extensions in CyberPanel.

More CyberPanel guides
Tested on CyberPanel 3.0 (build 8, OpenLiteSpeed edition) on Ubuntu 24.04, October 2026. Menu names can change slightly between versions.

Attached Files

Image(s)
   
Reply
Possibly Related Threads…matched by title
Replies:0Views:122
Replies:0Views:104

Users browsing this thread: 1 Guest(s)
Forum Jump: