Magento 2 heavily relies on the php.ini setting to make 100% sure that magento will run without any error.

While installing magento 2 you may encounter “Readiness Check” Errors.

The reasons for those errors are either you have not created local php.ini file for your project in the project folder or magento is unable to load your local php.ini file which you created in your project.

First step is to configure your local project php.ini file.

open the “php.ini” file from your magento root directory, in my case it is  /public_html/magento/php.ini
Add necessary variables

For example I have added following line to php.ini file

always_populate_raw_post_data = -1

Save the file

Next step is to check if you have php.ini file created in setup directory.

/public_html/magento/setup/php.ini

If there is no php.ini file in setup directory then copy the php.ini file from magento root directory and paste in setup directory

copy /public_html/magento/php.ini to /public_html/magento/setup/php.ini

Last step is to make sure either your php.ini file is loaded in magento

Open
/public_html/magento/setup/src/Magento/Setup/Model/PhpReadinessCheck.php
Search for “checkPopulateRawPostSetting” function

In that function call “phpinfo();” function and save the file

private function checkPopulateRawPostSetting()
 {
    phpinfo();
    ...

Visit following url according to your website

http://yoursite.com/magento/setup/index.php/environment/php-settings?type=installer

It will be showing phpinfo page
Search for “Loaded Configuration File” or “php.ini

It will be showing from where configuration file is loaded, if it is showing that php.ini is loaded from setup directory, you are all OK.

You can check all your custom settings here. Once ready remove phpinfo function and save the file and continue installing magento. It will work like a charm.

Advertisements