Customizing PHP settings: version, memory limit, and php.ini

Most PHP applications work fine with cPanel's default settings, but there are a handful of cases where you'll need to bump a setting: WordPress refusing to import a large file, Magento out-of-memory errors, Laravel needing a newer PHP version. This article covers all the ways to change PHP settings on your ipxcore cPanel account and which method to use when.

Change the PHP version

cPanel supports running different PHP versions on different domains within the same account. To switch:

  1. Open cPanel, find MultiPHP Manager (under "Software").
  2. Tick the box next to the domain (or domains) you want to change.
  3. Pick a version from the PHP Version dropdown. Available: PHP 7.4, 8.0, 8.1, 8.2, 8.3.
  4. Click Apply.

The change takes effect within seconds. If your site breaks (white screen, plugin errors, fatal errors), drop back one version and update the offending plugin or theme. PHP 8.x is roughly 2-3x faster than PHP 7.x, so worth the upgrade if your code supports it.

Change individual PHP settings

cPanel offers two interfaces for PHP setting changes — pick the one that matches your account's configuration:

Option A: MultiPHP INI Editor (most accounts)

  1. Open MultiPHP INI Editor in cPanel.
  2. Pick the domain.
  3. You'll see a list of editable settings:
    • memory_limit — max RAM a single PHP process can use
    • post_max_size — max size of an HTTP POST (form submission)
    • upload_max_filesize — max size of a single uploaded file
    • max_execution_time — seconds a script can run before being killed
    • max_input_time — seconds PHP spends parsing input data
    • display_errors — whether errors show on the page (turn OFF for production)
  4. Click Apply.

Option B: PHP Selector (CloudLinux accounts)

If your account runs on CloudLinux (most reseller and shared accounts on ipxcore), you'll see Select PHP Version instead. It offers more granular control:

  1. Open Select PHP Version.
  2. The Extensions tab lets you enable/disable individual PHP extensions (curl, gd, intl, etc.).
  3. The Options tab is where you change settings like memory_limit, upload_max_filesize, etc.
  4. Changes save immediately.

Recommended values for common applications

WordPress (typical site)

  • memory_limit = 256M
  • upload_max_filesize = 64M
  • post_max_size = 64M
  • max_execution_time = 60

WordPress with WooCommerce

  • memory_limit = 512M
  • upload_max_filesize = 128M
  • post_max_size = 128M
  • max_execution_time = 120

Magento 2

  • memory_limit = 1024M
  • upload_max_filesize = 256M
  • post_max_size = 256M
  • max_execution_time = 1800 (cron and indexer can run long)

Laravel

  • memory_limit = 512M
  • upload_max_filesize = 64M
  • post_max_size = 64M
  • max_execution_time = 90

Per-directory PHP settings via .htaccess

For one-off changes scoped to a single directory, you can override settings in .htaccess:

php_value upload_max_filesize 256M
php_value post_max_size 256M
php_value memory_limit 512M
php_value max_execution_time 300

This works only if your account uses Apache mod_php (older accounts). On modern PHP-FPM-based accounts (most ipxcore accounts), php_value directives in .htaccess are ignored. Use the cPanel UI methods above instead.

Verify your changes took effect

The fastest way to confirm: create a tiny PHP file at public_html/phpinfo.php with this content:

<?php phpinfo();

Visit https://yourdomain.com/phpinfo.php and search the page for the setting name. The "Local Value" column shows what's actually in effect.

Important: delete the file when done. phpinfo() reveals server paths and module versions that attackers can use to find vulnerabilities.

Common pitfalls

  • WordPress still says "memory limit reached" even after raising it. WordPress also has its own constant: add define('WP_MEMORY_LIMIT', '512M'); to wp-config.php.
  • Setting changes don't apply. If your account uses PHP-FPM, settings are cached for 30-60 seconds. Wait, then refresh.
  • Hosting limits. ipxcore caps individual settings to prevent runaway scripts impacting other accounts. memory_limit can typically be set up to 1024M on shared and 4096M on reseller. Open a ticket if you need higher.
  • Setting one without the others. upload_max_filesize alone won't work if post_max_size is smaller. Always set both, with post_max_size >= upload_max_filesize.
  • PHP, php.ini, memory limit, upload size, cPanel
  • 0 Usuários acharam útil
Esta resposta lhe foi útil?

Artigos Relacionados

Nameservers

The nameservers to use for our webhosting services are below: all1.dnsroundrobin.net...

Setting up Dynamic DNS in cPanel

cPanel includes a built-in Dynamic DNS feature that automatically keeps an A record pointed at a...

Setting up Cloudflare with cPanel: the right way

Cloudflare is a free CDN and DDoS-protection service that sits in front of your ipxcore cPanel...

Speeding up WordPress on cPanel hosting

A slow WordPress site costs you visitors, conversions, and search rankings — Google has...

How to migrate your website to ipxcore from another host

Migrating an existing website to ipxcore is a process we've helped thousands of customers...