How to Increase PHP Memory Limit in cPanel
Posted about 8 months ago 3.8kImmediate Fix (2 Minutes)
Recommended: Use cPanel PHP Selector for easiest fix
Method 1: cPanel PHP Selector
- Login to cPanel
- Go to "Select PHP Version"
- Click "Switch to PHP Options"
- Find "memory_limit" option
- Change value to 256M
- Click "Apply"
Alternative Methods
Method 2: .user.ini File
# Create in public_html
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
Method 3: .htaccess (Apache)
php_value memory_limit 256M
Recommended Memory Limits
| Application | Memory Limit |
|---|---|
| WordPress | 256M - 512M |
| Magento | 512M - 1G |
| Joomla | 256M |
| Custom PHP | 128M - 256M |
Verify Changes
<?php
echo ini_get('memory_limit');
?>
Create this as info.php in your public_html and visit it.