Joomla PHP.ini settings are the PHP runtime limits and switches (memory, upload size, execution time, input variables, error display, OPcache) that decide whether Joomla 4, 5, or 6 installs cleanly, updates without timeouts, and uploads extensions without silent failures. Joomla 6 needs PHP 8.3.0 or newer (8.4 recommended) and at least 256M memory. You do not edit these inside Joomla. You read the effective values under System → System Information → PHP Information, then change them through your host panel, a .user.ini or php.ini file, an FPM pool, or .htaccess (module mode only).
Most “ultimate” php.ini posts paste one block of values and skip the part that actually breaks sites: which file PHP reads on your server. A php_value line in .htaccess throws a 500 on PHP-FPM. A php.ini in the web root does nothing under some SAPIs. post_max_size smaller than upload_max_filesize silently caps uploads. This guide is the operator version: requirements by Joomla version, a decision table for where to set values, recommended numbers, DIY files for each server type, and a troubleshooting map.
What you will learn
- PHP versions and modules Joomla 4, 5, and 6 require
- How to read the effective PHP values Joomla actually runs with
- Which file wins: php.ini, .user.ini, .htaccess, FPM pool, or host panel
- Recommended values for memory, uploads, execution time, max_input_vars, OPcache
- DIY edits for cPanel, WHM, Plesk, .user.ini, Nginx + PHP-FPM, and XAMPP
- Production hardening: display_errors, disable_functions, session paths
- Fixes for memory exhausted, upload caps, timeouts, and 500 errors from php_value
PHP requirements by Joomla version
| Joomla | PHP minimum | PHP recommended | Notes |
|---|---|---|---|
| Joomla 6.x | 8.3.0 | 8.4 | Refuses to start below 8.3. Memory at least 256M |
| Joomla 5.x | 8.1.0 | 8.2 or 8.3 | Security-only support through October 2027 |
| Joomla 4.x | 7.2.5 | 8.2 | End of life. Move to 5.4 then 6 |
Required PHP modules for Joomla 6: json, simplexml, dom, zlib, gd, and mysqlnd or pdo_mysql or pdo_pgsql. Recommended: mbstring. Source: Joomla technical requirements. If your host still pins PHP 8.1 or 8.2, fix that before you tune any php.ini values for Joomla 6.
Where PHP actually reads its settings
This is the part thin guides skip. PHP has one main php.ini, but the value you see is the result of a chain. A later file or a host override can change it. Which override works depends on how PHP runs (the SAPI).
| Method | Works when | Does not work when | Typical hosts |
|---|---|---|---|
| Host panel (cPanel MultiPHP INI Editor, Plesk PHP Settings, “Select PHP Version”) | Almost always. Safest first choice | Value is locked by the host plan | Shared and managed hosting |
.user.ini in Joomla root |
PHP runs as CGI, FastCGI, or PHP-FPM | Apache mod_php (ignored). Only PHP_INI_PERDIR and PHP_INI_USER directives apply | Most modern shared hosting, LiteSpeed, Nginx + FPM |
php.ini in Joomla root |
suPHP / phpSuExec style CGI on older cPanel setups | FPM and mod_php usually ignore it; often not recursive to subfolders | Legacy cPanel |
php_value in .htaccess |
Apache with PHP as a module (mod_php) | PHP-FPM, CGI, FastCGI. Causes HTTP 500 “Invalid command php_value” | Older Apache stacks, some VPS |
FPM pool (php_admin_value) |
You control the server | Shared hosting | VPS, dedicated, Docker |
Main php.ini (/etc/php/…) |
Root access | Shared hosting | Own server |
Rule: pick one method per server. Do not stack .htaccess php_value on top of .user.ini and a panel. When they disagree, you spend hours chasing a value that “refuses to change.”
Step 1: Read the effective values in Joomla

- Administrator → System → System Information.
- Check PHP Version, Web Server, and the “PHP Built On” line. Note the Server API (mod_php, FPM, CGI, LiteSpeed). That decides your override method from the table above.
- Open the PHP Information tab. Search the page for
memory_limit,upload_max_filesize,post_max_size,max_execution_time,max_input_vars,display_errors,opcache.enable. - Note the “Loaded Configuration File” and “Additional .ini files parsed” rows. That is the file chain PHP actually used.

Trust this screen, not a php.ini you edited by hand. If the value you changed is not reflected here, PHP is reading a different file or the host caps it.
Step 2: Recommended values for Joomla 4, 5, and 6
| Directive | Practical value | Why Joomla needs it |
|---|---|---|
memory_limit |
256M (512M for VirtueMart, big ACL, or migrations) | Joomla recommends at least 256M. Too low gives “Allowed memory size exhausted” |
upload_max_filesize |
64M | Extension packages, templates, and media uploads |
post_max_size |
64M or larger than upload_max_filesize | PHP caps uploads at the smaller of the two. Must be equal or larger |
max_execution_time |
120 to 300 | Core updates, Akeeba backups, imports, large migrations |
max_input_time |
120 or -1 | Large multipart uploads over slow connections |
max_input_vars |
3000 to 5000 | Global Configuration permissions, big menus, and ACL forms exceed the 1000 default and save silently truncated |
display_errors |
Off on production | Never show PHP errors to visitors. Log them instead |
log_errors / error_log |
On, path outside web root | You still need the errors somewhere |
date.timezone |
Your server zone (for example Asia/Kolkata) | Cron, scheduled tasks, and publish dates |
opcache.enable |
1 | Biggest free PHP speed win. Usually on by default in PHP 8 |
realpath_cache_size |
4096K | Fewer filesystem stats on large Joomla trees |
These numbers are starting points for a normal business site. A brochure site on a tiny VPS can run 128M. A store doing imports can need 512M and 600 seconds. Tune from evidence in the PHP error log, not from a blog table.
Step 3: Change values in cPanel (most shared hosts)
- cPanel → Software → MultiPHP INI Editor (or “Select PHP Version” → Options on CloudLinux hosts).
- Basic Mode: pick your domain, then set memory_limit, upload_max_filesize, post_max_size, max_execution_time, max_input_vars.
- Apply. cPanel writes a
php.iniand.user.inifor that document root for you. - Reload System Information in Joomla and confirm the new values.
Also check cPanel → MultiPHP Manager to confirm the domain runs PHP 8.3 or 8.4 before Joomla 6 upgrades.
Step 4: Change values in WHM (server owners)

- Log in to WHM (port 2087).
- Software → MultiPHP INI Editor.
- Basic Mode for dropdowns, or Editor Mode to edit the full php.ini for one PHP version.
- Select the PHP version your Joomla domains use. Change the directives. Save.
- Restart PHP-FPM (or Apache in module mode) if the change does not appear in Joomla within a minute.
WHM edits apply server-wide for that PHP version. Use cPanel per account when only one site needs a bigger limit.
Step 5: Change values in Plesk
- Websites & Domains → your domain → PHP Settings.
- Set memory_limit, upload_max_filesize, post_max_size, max_execution_time, max_input_time, and add
max_input_vars = 5000under Additional directives. - Confirm the PHP version and handler (FPM by Apache or Nginx is common).
- Apply, then verify in Joomla System Information.
Step 6: DIY .user.ini in the Joomla root (CGI, FastCGI, PHP-FPM)
When the panel does not expose a value, create .user.ini in the same folder as Joomla’s index.php and configuration.php:
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
max_input_time = 300
max_input_vars = 5000
display_errors = Off
log_errors = On
- PHP re-reads
.user.inion a timer (user_ini.cache_ttl, default 300 seconds). Wait five minutes or restart FPM before you judge it “not working.” - Only PHP_INI_PERDIR and PHP_INI_USER directives apply.
disable_functions,open_basedir, OPcache size, and other PHP_INI_SYSTEM values cannot be set here. - Protect it. Current Joomla
htaccess.txtblocks direct access to.user.inistyle files on Apache. On Nginx, deny dotfiles in the vhost. - Joomla’s administrator folder has its own request path. If admin uploads still fail, copy the same
.user.iniintoadministrator/.
Step 7: DIY php.ini in the Joomla root (legacy suPHP / phpSuExec)
Older cPanel servers running PHP as CGI with suPHP read a php.ini from the script directory instead of .user.ini. Same directives, different filename:
memory_limit = 256M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300
max_input_vars = 5000
Under suPHP the file is often not recursive. Copy it into administrator/ as well. If a php.ini in the root changes nothing, you are not on suPHP. Use Step 6 or the panel.
Step 8: .htaccess php_value (Apache mod_php only)
Use this only when System Information shows Server API “Apache 2.0 Handler” (mod_php). On PHP-FPM, CGI, and FastCGI these lines break the site with a 500 error.
<IfModule mod_php.c>
php_value memory_limit 256M
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_vars 5000
</IfModule>
Wrapping in IfModule avoids the 500 when a host migrates you to FPM later, but the values then silently stop applying. Prefer .user.ini on any host newer than about 2018.
Step 9: Nginx + PHP-FPM pool (VPS and dedicated)
Edit the pool file (for example /etc/php/8.4/fpm/pool.d/www.conf or your site’s pool):
php_admin_value[memory_limit] = 256M
php_admin_value[upload_max_filesize] = 64M
php_admin_value[post_max_size] = 64M
php_admin_value[max_execution_time] = 300
php_admin_value[max_input_vars] = 5000
php_admin_flag[display_errors] = off
php_admin_flag[log_errors] = on
php_admin_value[error_log] = /var/log/php/joomla-error.log
Then restart the service (for example systemctl restart php8.4-fpm). Match Nginx too, or uploads still fail at the proxy before PHP sees them:
client_max_body_size 64m;
fastcgi_read_timeout 300;
php_admin_value locks the setting so .user.ini cannot override it. Use plain php_value in the pool if you want per-site files to win.
Step 10: XAMPP, MAMP, and local development
- Find the loaded php.ini: XAMPP Control Panel → Apache → Config → php.ini (usually
C:\xampp\php\php.ini). On macOS MAMP it lives under the selected PHP version folder. - Back the file up, then search for each directive and raise memory_limit, upload_max_filesize, post_max_size, max_execution_time, max_input_vars.
- Set
display_errors = Onlocally so you see problems that production hides. - Restart Apache from the control panel. CLI PHP uses a separate php.ini on many local stacks, so
php -imay show different values from the browser. - Verify with a throwaway
info.phpcontaining<?php phpinfo();, then delete it. Never leave phpinfo files on production.
Step 11: OPcache and production hardening
Where you control the main php.ini or FPM pool:
opcache.enable = 1
opcache.memory_consumption = 192
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 20000
opcache.validate_timestamps = 1
opcache.revalidate_freq = 60
- Joomla 5 and 6 with a few extensions easily exceed 10000 PHP files. Keep
max_accelerated_fileshigh (the value rounds up to a prime). - Keep
validate_timestamps = 1unless your deploy restarts FPM. With it at 0, a Joomla update can leave stale code cached and show broken pages until restart. - Drop the ancient
opcache.fast_shutdownline from old tutorials. It was removed in PHP 7.2.
Security directives that belong in server-level php.ini, not .user.ini:
expose_php = Off
allow_url_include = Off
session.cookie_httponly = 1
session.cookie_secure = 1
session.use_strict_mode = 1
disable_functions = exec,passthru,shell_exec,system,proc_open,popen
Test disable_functions on staging first. Some backup and image extensions need exec for ImageMagick or archive tools. Joomla itself does not need those functions.
Step 12: Verify and troubleshoot
- Reload System → System Information → PHP Information and confirm every value you changed.
- Upload a 30 to 50 MB extension zip through System → Install → Extensions.
- Save Global Configuration → Permissions once. If a permission change does not stick, raise max_input_vars.
- Run a Joomla core update or a full backup and watch for timeouts.
- Check the PHP error log path you configured actually receives entries.
| Symptom | Likely cause | Fix |
|---|---|---|
| Allowed memory size of 134217728 bytes exhausted | memory_limit 128M | Raise to 256M (or 512M for stores and migrations) |
| Upload fails or “file too large” at a size below your setting | post_max_size smaller than upload_max_filesize, or Nginx client_max_body_size | Set post_max_size equal or larger; raise Nginx limit |
| Extension install “Unable to write” or blank page after upload | max_execution_time or memory during unzip | Raise both; check tmp folder permissions |
| HTTP 500 right after editing .htaccess | php_value on PHP-FPM or CGI | Remove the lines; use .user.ini or the panel |
| Values in .user.ini never appear | mod_php, wrong folder, or cache_ttl not elapsed | Check Server API; place the file beside index.php; wait 5 minutes or restart FPM |
| Permissions or menu saves lose fields | max_input_vars 1000 | Raise to 3000 to 5000 |
| Site slow after every update | OPcache off or too small | Enable OPcache; raise max_accelerated_files |
| Joomla 6 upgrade blocked | PHP below 8.3 | Switch PHP version in the panel first |
Joomla settings that sit on top of PHP
- Media upload limit: Content → Media → Options has its own Maximum Size. PHP limits win if they are smaller.
- Session lifetime: Global Configuration → System → Session Lifetime (minutes) works with PHP
session.gc_maxlifetime. Keep the PHP value at or above Joomla’s, in seconds. - Error Reporting: Global Configuration → Server. Maximum overrides PHP display settings. Keep None on production. Details: disable deprecated Joomla messages.
- Gzip and cache: zlib must be present for Gzip Page Compression; cache handlers are covered in caching in Joomla.
When php.ini is not the real problem
If you keep raising memory and time to get a Joomla 3 site through a PHP 8 upgrade, the problem is abandoned extensions and an old template, not PHP limits. Fix the platform. Infyways upgrades start at $149 with a free audit within 12 hours: Joomla Upgrade Services. For ongoing server tuning, see Joomla support and maintenance.
What thinner articles leave out
| Topic | Typical post | This guide |
|---|---|---|
| Which file PHP reads | “Edit php.ini” | Decision table by Server API: panel, .user.ini, php.ini, .htaccess, FPM pool |
| Joomla versions | Joomla 3 or 4 numbers | Joomla 6 needs PHP 8.3+, 8.4 recommended, 256M minimum |
| Upload caps | upload_max_filesize only | post_max_size, max_input_time, Nginx client_max_body_size |
| max_input_vars | Missing | Why ACL and menu saves truncate |
| 500 after .htaccess | Unexplained | php_value on FPM/CGI and the fix |
| OPcache | Copy-pasted PHP 5 block | PHP 8 values, validate_timestamps, removed fast_shutdown |
| Verification | phpinfo file left on server | System Information plus real upload, save, and update tests |
Key takeaways
- Joomla 6 needs PHP 8.3.0 or newer, 8.4 recommended, with at least 256M memory.
- Read effective values in System → System Information → PHP Information before and after every change.
- Choose the override method by Server API: panel first, then .user.ini on FPM/CGI, .htaccess php_value only on mod_php.
- Set post_max_size equal to or larger than upload_max_filesize, and match Nginx client_max_body_size.
- Raise max_input_vars to 3000 to 5000 so permissions and menus save completely.
- Keep display_errors Off and log_errors On in production.
- Enable OPcache with a high max_accelerated_files and validate_timestamps on.
- Do not stack multiple override files. One method per server.
Frequently asked questions
Where is the php.ini file for Joomla?
Joomla has no php.ini of its own. PHP loads the server’s php.ini plus overrides. Find the loaded file under System → System Information → PHP Information (“Loaded Configuration File”).
What PHP version does Joomla 6 require?
PHP 8.3.0 minimum, PHP 8.4 recommended. Joomla 5 runs on PHP 8.1 or newer, with 8.2 or 8.3 recommended.
What memory_limit should I set for Joomla?
256M for most sites. Use 512M for VirtueMart, HikaShop, large ACL trees, and migrations.
Why does .htaccess php_value give a 500 error?
PHP is running as FPM, CGI, or FastCGI, so Apache does not understand php_value. Remove the lines and use .user.ini or your host panel.
What is the difference between php.ini and .user.ini?
php.ini is the main server configuration (and a per-directory file on legacy suPHP). .user.ini is the per-directory override PHP reads under CGI, FastCGI, and FPM. Only per-directory and user-level directives apply in .user.ini.
Why can I not upload a 50 MB extension after raising upload_max_filesize?
post_max_size is still smaller, or Nginx client_max_body_size blocks the request. Raise both to at least the upload size.
What is max_input_vars and why does Joomla need it?
It caps how many form fields PHP accepts per request. The 1000 default truncates Joomla permission and menu forms. Set 3000 to 5000.
Should display_errors be on in Joomla?
No, not on production. Turn it Off, keep log_errors On, and use Joomla Error Reporting None. Enable it only on staging or local.
Do I need to restart anything after editing php.ini?
Main php.ini and FPM pool changes need a PHP-FPM or Apache restart. .user.ini changes apply after user_ini.cache_ttl (default 300 seconds). Panel edits usually handle the restart for you.
Where do we start if PHP limits keep breaking a Joomla upgrade?
Request a Joomla upgrade audit. We check PHP version, limits, extensions, and template compatibility before touching production.
