When installing Ecshop V2.7.3 on PHP7, the error!
Deprecated:methods with the same name as their class won't is 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 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 ' constructor ';
}
}
? >
Back to Ecshop let's take a look at the 25 lines of the cls_ecshop.php file. As follows
Sure enough, we have the same construction method as the class name, and we modify the construction method ECS to __construct,
Back to the Ecshop installation homepage refresh, found that there is no error.
Click Next to Error
Deprecated:non-static method Cls_image::gd_version () should the not to called statically in/usr/local/nginx/html/ecshop/ upload/install/includes/lib_installer.php on line 31
The reason for this error is static call non-static method, 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. 31 Lines of code lib_installer.php
There is also the GD version () method of the CLS image class file, which you can see does not use the static keyword
The first way to modify the method to a static method is to add the keyword public static before the method
The second way to modify the lib_installer.php 31 lines of code is to use a non-static call
Both of these methods can solve the problem. Go back to the Ecshop installation step on the second page, 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 does not change the operation of the MySQL API can not run on the PHP7.
ONEAPM for PHP is able to drill down into all PHP applications within the application can be managed and monitored within all PHP applications, including the 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.
The above mentioned to share the Ecshop migration to the PHP7 version of the compatibility problems encountered, I hope to help.