ECshop compatibility issues encountered while migrating to the PHP7 version, ECSHOPPHP7

Source: Internet
Author: User
Tags deprecated php class

ECshop compatibility issues encountered while migrating to the PHP7 version, ECSHOPPHP7

When installing ECShop V2.7.3 on PHP7, Error!

Deprecated:methods with the same name as their class won't is constructors in a future version of PHP; ECS have a deprecated constructor in/usr/local/nginx/html/ecshop/upload/includes/cls_ecshop.php on line 25

The reason for this error is that PHP7 no longer supports the same construction method as the class name, and the construction method uses __construct () uniformly, such as the following PHP7 will report this error.

<?php class Foo {function foo () {echo ' I am the constructor ';}}? >

Back to Ecshop let's take a look at line 25 of the cls_ecshop.php file. As follows

As expected, there is the same construction method as the class name, we will construct the method ECS to __construct,

Back to the Ecshop installation home refresh, found that there is no error.

Click Next to Error

Deprecated:non-static method Cls_image::gd_version () should not be called statically in/usr/local/nginx/html/ecshop/ upload/install/includes/lib_installer.php on line 31

The reason for this error is static calls to non-static methods, such as the following code will report this error

<?php class Foo {function bar () {echo ' I am not static! ';}} Foo::bar ();?>

The modification method is also simple, either by changing the method to a static method or by changing the call to a non-static call. Let's take a look at the error file lib_installer.php 31 lines of code

There is also the GD version () method of the CLS image class file, and you can see that the static keyword is not actually used

The first modification, modifies the method to a static method, and adds the keyword public static before the method

The second method of modification, using non-static calls, modifies the lib_installer.php 31 lines of code

Both of these methods can solve the problem. Go back to the Ecshop installation step on page two and the error message is gone.

Next tragedy, PHP7 does not support the original MySQL API, PHP7 support better mysqli API and Pdo_mysql API so ecshop do not get rid of the operation of the MySQL API is not able to run on the PHP7.

OneAPM for PHP is able to drill down into all of the PHP applications to perform application performance management in-depth application performance management and monitoring within all PHP applications, including code-level visibility, rapid identification and traceability of performance bottlenecks, real user experience monitoring, Server monitoring and end-to-end application performance management.

ECshop compatibility issues encountered while migrating to the PHP7 version, ECSHOPPHP7

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.