Solution Magento 2.1.3 on PHP 7.1.0

Source: Internet
Author: User
Tags mcrypt

here's how to in the latest PHP 7.1.0 on install and run the latest Magento 2.1.3 .

Patch installation files

Magento 2.1.3 Check the PHP version and refuse to install it using PHP 7.1.0. We'll get around it .

Open setup/src/magento/setup/model/phpredinesscheck.php and Change line 79th

From:

$normalizedPhpVersion = $this->getnormalizedcurrentphpversion (php_version);
To:

$normalizedPhpVersion = $this->getnormalizedcurrentphpversion (' 7.0.2 ');

2. Prohibit MCrypt warning

Edit vendor/magento/framework/encryption/crypt.php and associate all Mcrypt/mdecrypt functions with @

@mdecrypt_generic
This is a diff file:

54c54
< $this->_handle = @mcrypt_module_open ($cipher, ', $mode, ');
---
> $this->_handle = Mcrypt_module_open ($cipher, ', $mode, ');
56c56
< $maxKeySize = @mcrypt_enc_get_key_size ($this->_handle);
---
> $maxKeySize = mcrypt_enc_get_key_size ($this->_handle);
62c62
< $initVectorSize = @mcrypt_enc_get_iv_size ($this->_handle);
---
> $initVectorSize = mcrypt_enc_get_iv_size ($this->_handle);
80c80
< @mcrypt_module_close ($this->_handle);
---
> Mcrypt_module_close ($this->_handle);
83c83
< @mcrypt_generic_init ($this->_handle, $key, $initVector);
---
> Mcrypt_generic_init ($this->_handle, $key, $initVector);
93,94c93,94
< @mcrypt_generic_deinit ($this->_handle);
< @mcrypt_module_close ($this->_handle);
---
> Mcrypt_generic_deinit ($this->_handle);
> Mcrypt_module_close ($this->_handle);
138c138
< return @mcrypt_generic ($this->_handle, $data);
---
> Return mcrypt_generic ($this->_handle, $data);
152c152
< $data = @mdecrypt_generic ($this->_handle, $data);
---
> $data = mdecrypt_generic ($this->_handle, $data);
Clear cache:

RM-RF var/cache/*
RM-RF var/generation/*

Solution Magento 2.1.3 on PHP 7.1.0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.