You try uploading a 64MB theme zip or importing a bulky WooCommerce catalog, and WordPress instantly slaps you with “The uploaded file exceeds the upload_max_filesize directive in php.ini” or a blank white screen with “Fatal error: Allowed memory size of 134217728 bytes exhausted”. Here is how to bump your PHP memory limit, upload ceiling, and execution timeouts across Hostinger hPanel and your WordPress config files in about five minutes.

Why Hostinger’s Default Limits Choke Themes and Plugins
Fresh WordPress installs on shared and cloud hosting usually launch with conservative baseline limits—typically 128MB or 256MB of PHP memory and upload caps between 32MB and 128MB. That works fine for a lightweight blog with five plugins, but it falls apart the second you spin up Elementor, run complex database migrations, or import full demo sites.
Heavy plugins chew through server memory before writing anything to MySQL. If your site tries to crop high-res images, compile Sass, or run an API sync that demands 310MB of RAM while PHP is capped at 256MB, the runtime kills the process immediately to protect the server. You get a broken import, failed saves, or an HTTP 500 error. If you hit a stalled demo import, check out our walkthrough on how to fix Envato theme demo import failed or stuck in WordPress.
Check Your Current PHP Limits in WordPress Site Health
Before editing any config files, check what limits your site is actually running. WordPress displays these values directly in the admin area:
- Head to your WordPress admin dashboard.
- Go to Tools > Site Health.
- Click the Info tab.
- Open the Server section to view
PHP memory limit,PHP time limit, andPHP max input variables. - Open the Media Handling section to verify
Max size of an uploaded file.
Keep these numbers handy so you can confirm whether your hPanel changes actually took effect.
Method 1: Change PHP Limits Directly in Hostinger hPanel
Hostinger runs on LiteSpeed Web Server, which lets you tweak per-domain PHP directives right inside hPanel. This is the cleanest route because it sets environment variables at the server level without touching core WordPress files.
- Log in to Hostinger and open hPanel.
- Navigate to Websites and click Manage next to your site.
- In the left sidebar, search for PHP Configuration (under Advanced).
- Click the PHP Options tab.
- Adjust these values:
memory_limit: Set to512M(or1024Mon Business/Cloud plans).upload_max_filesize: Set to256Mor512M.post_max_size: Set to256Mor512M(keep this equal to or higher thanupload_max_filesize).max_execution_time: Set to300.max_input_time: Set to300.max_input_vars: Set to5000.
Scroll down and hit Save. LiteSpeed applies the directives immediately—no server reboot required.
Method 2: Define Memory Limits in wp-config.php
Sometimes Hostinger allocates the memory properly, but WordPress still caps itself at its internal runtime defaults (40MB for frontend queries, 64MB for the admin panel). You can force WordPress to use your full allocation inside wp-config.php.
Open Hostinger File Manager (or connect via SFTP), find public_html/wp-config.php, and drop this snippet right above the line reading /* That's all, stop editing! Happy publishing. */:
define('WP_MEMORY_LIMIT', '512M');
define('WP_MAX_MEMORY_LIMIT', '512M');WP_MEMORY_LIMIT sets the ceiling for frontend requests, while WP_MAX_MEMORY_LIMIT covers heavy administrative tasks in /wp-admin/ like batch operations, image generation, and plugin updates. Read up on these constants in the WordPress wp-config.php documentation.
The Gotcha: Why post_max_size Must Exceed upload_max_filesize
A classic pitfall is bumping upload_max_filesize while leaving post_max_size untouched at a lower number. In PHP, any file upload is sent inside an HTTP POST payload.
If you configure upload_max_filesize = 256M but leave post_max_size = 64M, any file over 64MB silently breaks the entire request. PHP simply discards the payload, wiping both the $_FILES and $_POST arrays. WordPress then throws cryptic messages like “The link you followed has expired” or crashes the admin view. You can check the low-level mechanics in the PHP core ini directives reference.
Keep this hierarchy intact:
memory_limit >= post_max_size >= upload_max_filesizeIf you set memory_limit = 512M, make sure both post_max_size and upload_max_filesize sit at 256M.
Method 3: Modify .user.ini for LiteSpeed and FastCGI
Because Hostinger runs LiteSpeed, it reads custom per-directory settings from a .user.ini file inside your public_html/ directory. If hPanel settings aren’t sticking for a specific folder or plugin, configure .user.ini directly.
Open or create public_html/.user.ini in the hPanel File Manager and paste:
upload_max_filesize = 256M
post_max_size = 256M
memory_limit = 512M
max_execution_time = 300
max_input_vars = 5000LiteSpeed checks .user.ini every few minutes. To force it to reload right away, toggle your PHP version in hPanel or restart the PHP process from your dashboard.
Method 4: Update Directives Using .htaccess
If your setup parses Apache-style php_value flags, you can drop your directives into .htaccess. Add this block to the very top of your public_html/.htaccess:
php_value upload_max_filesize 256M php_value post_max_size 256M php_value memory_limit 512M php_value max_execution_time 300 php_value max_input_time 300
A quick warning: on LiteSpeed environments running LSPHP, adding php_value to .htaccess can trigger an HTTP 500 error depending on the exact handler mode. If your site breaks after saving this, remove it immediately and stick with Method 1 or Method 3.
Verify Applied Limits via WP-CLI or SSH
If you prefer the command line, SSH into your Hostinger account and verify active settings in seconds.
Connect over SSH:
ssh -p 65002 u123456789@your-server-ipNavigate to your site root and query your active runtime values with WP-CLI:
cd public_html
wp eval "echo 'PHP Memory Limit: ' . ini_get('memory_limit') . PHP_EOL;"
wp eval "echo 'Upload Max Filesize: ' . ini_get('upload_max_filesize') . PHP_EOL;"
wp eval "echo 'Post Max Size: ' . ini_get('post_max_size') . PHP_EOL;"Your terminal should output the new values (like 512M and 256M).
Troubleshooting Stubborn Memory and Upload Errors
If you raised everything in hPanel and updated wp-config.php but WordPress still throws memory or upload limits, check these edge cases:
- Multisite Upload Quotas: On WordPress Multisite, go to Network Admin > Settings and find Upload Settings. WordPress defaults sub-site uploads to 1500KB, ignoring your PHP limits until you update it there.
- Elementor Admin Crashes: Elementor burns through memory when compiling massive template packs. If you run into save errors, take a look at our guide on how to fix Elementor 403 forbidden and server errors when saving.
- Object Cache Bloat: Memory spikes can happen when Redis is overloaded with massive transients. See how to configure Redis Object Cache on Hostinger for faster WordPress to keep your memory clean.
- Cloudflare 100MB Hard Cap: If your domain is proxied through Cloudflare’s free tier, any upload over 100MB triggers an HTTP 413 (Payload Too Large) error at the edge—no matter how high your Hostinger limits are. For uploads above 100MB, upload via SFTP or temporarily switch Cloudflare to DNS-only during the migration.
Frequently Asked Questions
Can I set PHP memory_limit to -1 (unlimited) in Hostinger?
Don’t do this. While PHP supports memory_limit = -1 on dedicated instances, Hostinger runs CloudLinux with strict OS-level container limits (LVE). Setting unlimited memory on shared or cloud plans will cause the kernel to kill the PHP process instantly when it spikes. Keep it capped at 512M or 1024M.
Why does WordPress Site Health show 256MB when I set 512MB in wp-config.php?
Server-level master configs always take precedence over WordPress constants. If your wp-config.php changes aren’t registering, update the values via hPanel > Advanced > PHP Configuration > PHP Options so the host runtime matches.
Will increasing my PHP memory limit slow down my website?
No. The memory limit is a hard ceiling, not a constant RAM reservation. A standard page view will still use only 30MB–60MB of RAM. The higher limit just ensures complex tasks have enough headroom to finish without crashing.
What should I do if demo imports keep timing out even after increasing limits?
Bump max_execution_time to 600 and max_input_vars to 10000. If you are importing on a live site, test on a staging clone first. Check our guide on how to set up a WordPress staging site in Hostinger hPanel to run heavy imports safely.

