How to Install Magento 2.1.3 on PHP 7.1.0

magento on php 7
magento on php 7

Here is how to install and run the latest Magento 2.1.3 on the latest PHP 7.1.0

Disclaimer: although this hack is tested on the default Magento 2.1.3 sample data installation use this with caution for production sites. always test test test!

Patch installation files

Magento 2.1.3 checks php version and refuses to install with php 7.1.0. Let’s bypass it.

Open up setup/src/Magento/Setup/Model/PhpRedinessCheck.php and change line 79

from:

$normalizedPhpVersion = $this->getNormalizedCurrentPhpVersion(PHP_VERSION);

to:

$normalizedPhpVersion = $this->getNormalizedCurrentPhpVersion('7.0.2');
Suppress mcrypt warnings

Edit vendor/magento/framework/Encryption/Crypt.php and prefix all mcrypt/mdecrypt functions with @ :

@mdecrypt_generic

here 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);

rm -rf var/cache/*
rm -rf var/generation/*

WordPress 4.7.3 Security & Maintenance Release

wordpress upgrade
wordpress upgrade

WordPress 4.7.3 is now available. This is a security release for all previous versions and we strongly encourage you to update your sites immediately.

WordPress versions 4.7.2 and earlier are affected by six security issues:

 

  • Control characters can trick redirect URL validation.
  • Reported by Daniel Chatfield.

 

  • Unintended files can be deleted by administrators using the plugin deletion functionality.
  • Reported by xuliang.

 

  • Cross-site scripting (XSS) via video URL in YouTube embeds.
  • Reported by Marc Montpas.

 

  • Cross-site scripting (XSS) via taxonomy term names.
  • Reported by Delta.

Cross-site request forgery (CSRF) in Press This leading to excessive use of server resources.

Reported by Sipke Mellema.

Thank you to the reporters for practicing responsible disclosure.

In addition to the security issues above, WordPress 4.7.3 contains 39 maintenance fixes to the 4.7 release series. For more information, see the release notes or consult the list of changes.

Download WordPress 4.7.3 or venture over to Dashboard → Updates and simply click “Update Now.” Sites that support automatic background updates are already beginning to update to WordPress 4.7.3.

How to activate CloudFlare in the cPanel customer interface

Step 1 – Find CloudFlare in the Control Panel

After the CloudFlare plugin is installed, you will see a CloudFlare icon in cPanel.

 

Step 2 – Activation

If they already have a CloudFlare direct account, sign-in. If not, click on Sign up.


Step 3 – CNAME or Full DNS setup

CNAME setup :  By default, CloudFlare is set up for your customers using CNAME. To enable CloudFlare on CNAME​, please click
Provision Domain with CNAME Setup​ green button.

Full DNS option

Once you enable the Full DNS option in the config.js file, your customers can select and use either CNAME or Full DNS setup. Customers will need to refresh the page after the hosting provider updates their name servers
to CloudFlare’s name servers.

Step 4 – Enable CloudFlare for subdomains

For subdomains, click the grey cloud icon and toggle to orange. This means traffic will flow through CloudFlare for these subdomains.

Enable CloudFlare for subdomains

 

Enable CloudFlare for subdomains

Step 5 — Analytics

Your can see CloudFlare analytics for each site by clicking the “Analytics” icon

Step 5 — Additional settings and upgrades

Users can now control more CloudFlare security settings right from cPanel.

In addition to selecting the basic security level of your site from Essentially Off, Low, Medium, or High, you can configure the Challenge Passage, which specifies how long a visitor is allowed access to your website after completing a challenge.

You can enable Browser Integrity Check which evaluates HTTP headers from your visitors browser for threats, if a threat is found a block page will be delivered. In addition, users can select ‘I’m under attack mode’ when experiencing a DDoS attack on Layer 7. To access additional settings and upgrade from “Free” to “Pro”, customers need to log in to their cloudflare.com account.