1

when I execute phpinfo() it says 2000M, but when i run Readiness Check it give me 128M... what I have to do?

phpinfo()

enter image description here

I don't understand where it takes this value, is there any way to skip this check? I tried to edit the PhpReadinessCheck.php file but it doesn't work, maybe I have to refresh something?

1

There're 3 ways to change that value: using .htaccess, using php.ini, set value in php code.

You should review your index.php or app/bootstrap.php, maybe you will find this code ini_set('memory_limit', '128M'). Remove it.

If the problem is not resolved, try adding this ini_set('memory_limit', '768M') to your index.php.

The final solution:

Refresh the Magento crontab (is the configuration used to run Magento cron jobs for setup application) by running this command at Magento root folder:

bin/magento setup:cron:run
  • If i add ini_set('memory_limit', '768M') to my index.php when I print phpinfo() the new value is the value I set... but in the Readiness Check it give me always 128M! – Gianni Pasquali Jul 16 at 10:55
  • @GianniPasquali try open entire Mgaento project in Netbeans and find the string "memory_limit" in all the files inside it.Your problem is so weird! – Jamy Jul 16 at 13:41
  • I tryed but it found a lot of files, the weird thing is that looking for "128M" string it finds nothing, it find the string in "/var/.setup_cronjob_status" file where there is the alert message... I also modified the "PhpReadinessCheck.php" file in "setup\src\Magento\Setup" dir changing the alert message but by changing that text it does not change in the ReadinessCheck, perhaps after modifying that file should be done some operation via SSH? PS sorry for my english XD – Gianni Pasquali Jul 16 at 13:57
  • @GianniPasquali You're doing it right. Go to checkMemoryLimit() function in PhpReadinessCheck.php, replace this code $currentMemoryLimit = ini_get('memory_limit'); by $currentMemoryLimit = '768M';. Reload the Readiness Check to see the result :) – Jamy Jul 17 at 2:49
  • @GianniPasquali is it a fresh installation of Magento 2? If the above solution not work, let tweak the return array. 'warning' => $warning => 'warning' => false. The file is: setup/src/Magento/Setup/Model/PhpReadinessCheck.php – Jamy Jul 17 at 7:21
0

To increase your PHP memory limit:

  1. Locate your php.ini file using the following command:

php --ini

  1. As a user with root privileges, use a text editor to open the php.ini specified by Loaded Configuration File.

  2. Change Locate memory_limit to a value of 2GB for normal use and debugging. Save your changes to php.ini.

  3. Restart your web server.

CentOS service httpd restart

Ubuntu service apache2 restart

nginx (both CentOS and Ubuntu): service nginx restart

Try the installation again.

Hope it helps.

  • I tryed many times this method, it change the phpinfo() value but in the Readiness Check it give me always 128M! – Gianni Pasquali Jul 16 at 10:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.