Magento reports the wrong memory limit
Magento's readiness check reads the CLI PHP settings, not your web settings — so raising memory_limit in .user.ini appears to do nothing.
Magento's readiness check reports a lower memory_limit than you have set, and
raising it makes no difference. Applies to shared, reseller and Premium hosting.
The error looks like this:
Your current PHP memory limit is 512M. Magento 2 requires it to be set to 756M or more.
Meanwhile phpinfo() shows the value you set — say memory_limit 1024M.
Why it happens
Both readings are correct. They are reading different PHP configurations.
PHP on your account has two separate configurations: one for pages served over
the web, and one for the command line (CLI). Magento's readiness check runs
through the CLI, so it reads the CLI limit — not the web limit you raised in
.user.ini or the PHP Selector.
Fix it
Set the version and limits for the CLI as well:
- In cPanel, open Select PHP Version.
- Make sure the CLI version matches the version your site runs on.
- Open Options and set
memory_limitto756Mor higher.
Then clear Magento's cache, since it caches the readiness result:
php /home/cpaneluser/public_html/bin/magento cache:flushRun the readiness check again.
Confirm which limit you are reading
To see the CLI value directly:
php -i | grep memory_limitCompare it with what phpinfo() reports in a browser. If they differ, the CLI
is the one Magento is reading.
Related
Serve Laravel from the public directory
Point your domain at Laravel's /public folder using .htaccess, so visitors reach example.com rather than example.com/public.
Run PHP inside .html files
Make the server execute PHP in files with a .html or .htm extension, using the correct handler for WebGee's LiteSpeed setup.