Posts

Magento 2.1 setup readiness check fails – PHP version is empty

If the Magento 2.1 setup readiness check fails with an error message displaying nothing for the PHP version, similar to this:

PHP Version Check
Your PHP version is . The required PHP version is . Hide detail

You might also see error messages about open basedir restrictions, similar to this:

Cannot determine required PHP extensions: Warning: is_dir(): open_basedir restriction in effect. File(/etc/pki/tls/certs) is not within the allowed path(s):

The reason can be that Magento is by default expecting SSL/TLS. If not used, the above can occur.

Solution:

Edit the composer.json file and add a line to the config section so it looks like this:

 "config": {
  "use-include-path": true,
  "disable-tls": true
 },

I.e. add the line “disable-tls”: true (and don’t forget to add a “,” last on the preceding line). Now restart the setup.

Magento2 System Upgrade fails via Setup Wizard – Error in Update!

When trying to upgrade Magento from 2.0.2 to 2.0.4 I got a windows saying Update in progress and the last line from the system log says “./composer.json has been updated” then nothing more happens for quite a long time. Finally an error screen displays “Error in Update!”.

To restart the update process while trying to figure out the error i had to manually delete the files var/.maintenance.flag and var/.update_in_progress.flag.

Magento System Upgrade error

Magento System Upgrade error

To make Magento run in Apache we had set php.ini for the web user to memory_limit=1024M and according to instructions, the cron jobs should be called with the -c pointing to the php.ini used by the web server, in our case /etc/php5/fpm/php.ini.

No error message revealed why the update failed but I found out that the php.ini we used for cron (/etc/php5/fpm/php.ini) had a memory_limit=128M. By editing this file and increasing it to 1024M the update worked.

Magento and always_populate_raw_post_data readiness test fails

When running the Magento readiness test it failed with the message that always_populate_raw_post_data should be set to -1 since it is running under php 5.6. Even though I tried different methods of setting it to -1 and I could verify it by calling phpinfo(); Magento still complained.

The way I solved is a bit rough and it required that I had full system administrator access to the machine (which I had because it was a dedicated server). This is how I solved it:

echo "always_populate_raw_post_data=-1" > /etc/php5/mods-available/always_populate_raw_post_data.ini
php5enmod always_populate_raw_post_data
service php5-fpm restart
service apache2 restart

Magento “Cron readiness check failed” solved

First of all, check the Magento guide on this problem here.

In my case, at first I didn’t get any errors in the cron logs in <web-root>/var/log. When running the scripts by hand as the website user I got the not so informing “Cron readiness check failed” in the <web-root>/var/log/update.cron.log.

The reason the “Cron readiness failed” was actually due to some files in the file and directory structure in the web root that can not be written by the cron update script. In my case I used the AWstats package to create website statistics placed in a directory called /stats. This directory and it’s file was not writeable by the cron script, causing it to fail, even though the directory /stats and it’s files are not a part of Magento.

I discovered this by investigating the content of the file var/.update_cronjob_status. In this file you can find important information on why the cron update script is failing.