Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if ECshop is not compatible when migrating to the PHP7 version

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the knowledge of "what to do if ECshop is not compatible when migrating to PHP7 version". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Error when installing ECShop V2.7.3 on PHP7!

Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ECS has 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 constructor as the class name, and the constructor uses _ _ construct (). For example, the following PHP7 will report this error.

Going back to ecshop, let's take a look at the 25 lines of the cls_ecshop.php file. As follows

Sure enough, there is the same constructor as the class name. We modify the constructor ECS to _ _ construct

Go back to the installation home page of ecshop to refresh and find that there are no errors.

Click next to report an 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 that the non-static method is called statically. For example, the following code will report this error.

It is also easy to modify the method, either changing the method to a static method or changing the call to a non-static call. Let's take a look at the 31 lines of code in the error file lib_installer.php.

There is also the gd version () method of the cls image class file, and you can see that the static keyword is indeed not used

In the first way, the method is modified to a static method, with the keyword public static before the method.

The second way is to use a non-static call to modify 31 lines of code in lib_installer.php.

Both methods can solve the problem. Going back to the second page of the installation steps for ecshop, the error message has disappeared.

The next tragedy is that PHP7 does not support the original mysql api, and PHP7 supports better Mysqli API and pdo_mysql api, so ecshop cannot run on PHP7 without changing the api that operates on mysql.

OneAPM for PHP can go deep into all PHP applications to complete application performance management and monitoring, including visibility of code-level performance issues, rapid identification and traceability of performance bottlenecks, real user experience monitoring, server monitoring and end-to-end application performance management.

This is the end of the introduction to "what if ECshop is not compatible when migrating to the PHP7 version". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report