Step 1
Install PHP 7.2.
How do I install PHP 7.2 FPM and CLI for Magento 2 to Debian 9 (Stretch)?
Step 2
Disable the E_DEPRECATED
error handling level for PHP.
Step 3
Replace the line:
with the following one:
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0",
Step 4
Replace the line:
with the following one:
"colinmollenhour/cache-backend-file": "dev-master",
Step 5
How to adapt colinmollenhour/php-redis-session-abstract
to PHP 7.2?
Step 6
Replace the line:
with the following one:
"mage2pro/composer": ">=1.3.0",
Step 7
Replace the line:
with the following one:
"friendsofphp/php-cs-fixer": "*",
Step 8
Replace the line:
with the following one:
"pelago/emogrifier": ">=2.0.0",
Step 9
PHP 7.2 does not contain the mcrypt
extension.
In Debian, I install it from PECL on the Step 1 above:
pecl install mcrypt-snapshot
In Windows, I use the phpseclib/mcrypt_compat
shim:
composer require phpseclib/mcrypt_compat:*
Step 10
[PHP 7.2] My fix for «Warning: ini_set(): A session is active. You cannot change the session module’s ini settings at this time in lib/internal/Magento/Framework/Session/SessionManager.php on line 129»
Step 11
[PHP 7.2] My fix for «Declaration of Magento\Customer\Model\ResourceModel\Address\Attribute\Source\Country::getAllOptions()
must be compatible with Magento\Eav\Model\Entity\Attribute\Source\Table::getAllOptions($withEmpty = true, $defaultValues = false)
».
Step 12
[PHP 7.2] My fix for «Declaration of Magento\Customer\Model\ResourceModel\Address\Attribute\Source\CountryWithWebsites::getAllOptions()
must be compatible with Magento\Eav\Model\Entity\Attribute\Source\Table::getAllOptions($withEmpty = true, $defaultValues = false)
».
Step 13
[PHP 7.2] My fix for «Declaration of Magento\Customer\Model\ResourceModel\Address\Attribute\Source\Region::getAllOptions()
must be compatible with Magento\Eav\Model\Entity\Attribute\Source\Table::getAllOptions($withEmpty = true, $defaultValues = false)
».
Step 14
[PHP 7.2] My fix for «Declaration of Magento\Customer\Model\Customer\Attribute\Source\Website::getAllOptions()
must be compatible with Magento\Eav\Model\Entity\Attribute\Source\Table::getAllOptions($withEmpty = true, $defaultValues = false)
».
Step 15
[PHP 7.2] My fix for «Declaration of Magento\Customer\Model\Customer\Attribute\Source\Store::getAllOptions()
must be compatible with Magento\Eav\Model\Entity\Attribute\Source\Table::getAllOptions($withEmpty = true, $defaultValues = false)
».
Step 16
[PHP 7.2] My fix for «Declaration of Magento\Customer\Model\Customer\Attribute\Source\Group::getAllOptions()
must be compatible with Magento\Eav\Model\Entity\Attribute\Source\Table::getAllOptions($withEmpty = true, $defaultValues = false)
».
Step 17
[PHP 7.2] My fix for «Declaration of Magento\Eav\Model\Entity\Attribute\Source\Store::getAllOptions()
must be compatible with Magento\Eav\Model\Entity\Attribute\Source\Table::getAllOptions($withEmpty = true, $defaultValues = false)
».
Step 18
[PHP 7.2] My fix for «Declaration of Magento\Directory\Model\Config\Source\Country\Full::toOptionArray($isMultiselect = false)
must be compatible with Magento\Directory\Model\Config\Source\Country::toOptionArray($isMultiselect = false, $foregroundCountries = '')
».
Step 19
[PHP 7.2] My fix for «Declaration of Magento\Tax\Model\System\Config\Source\Tax\Country::toOptionArray($noEmpty = false)
must be compatible with Magento\Directory\Model\Config\Source\Country::toOptionArray($isMultiselect = false, $foregroundCountries = '')
».
Step 20
[PHP 7.2] My fix for «Warning: count()
: Parameter must be an array or an object that implements Countable
in lib/internal/Magento/Framework/View/Design/Theme/ThemeList.php
on line 237».
Step 21
[PHP 7.2] My fix for «Warning: count()
: Parameter must be an array or an object that implements Countable
in Magento/Theme/Block/Html/Topmenu.php
on line 241».
Step 22
[PHP 7.2] My fix for «Warning: count()
: Parameter must be an array or an object that implements Countable
in Magento/Backend/Block/Menu.php
on line 390».
Step 23
[PHP 7.2] My fix for «Warning: count()
: Parameter must be an array or an object that implements Countable
in Magento/Wishlist/Observer/AddToCart.php
on line 79».
Step 24
[PHP 7.2] My fix for «Warning: sizeof(): Parameter must be an array or an object that implements Countable in app/code/Magento/Sales/view/adminhtml/templates/order/totalbar.phtml on line 10».
The Magento 2 team is making Magento 2 compatible with PHP 7.2: github.com/magento-engcom/php-7.2-support/projects/1.
When the project will be finished then my patch will not be needed anymore.