Php Strict Standards: Only variables shocould be passed by reference in solution, strictvariables

Source: Internet
Author: User

Php Strict Standards: Only variables shocould be passed by reference in solution, strictvariables

This problem is mostly caused by referencing and passing parameters. The solution is to modify the code without using references. The other solution is to modify the php configuration file and change the error_reporting value to error_reporting = E_ALL &~ E_NOTICE. Or modify the reference method in the function.

Ps: when modifying the configuration file, it is best to copy a row, note it, and then change it, if you need to switch back at any time.

ECShop Strict Standards: Only variables shocould be passed by reference in Solution

When installing ecshop today, the following error occurs: Strict Standards: Only variables shocould be passed by reference in F: \ www.xxxx.com \ cls_template.php on line 418.

Solution:

Open the cls_template.php file and find the following code:

$tag_sel = array_shift(explode(' ', $tag));

I forgot to mention that my PHP version is 5.4.19 and PHP5.3 and above can only pass specific variables by default, but cannot pass through the function return value, so the explode in this code has to be moved out and assigned a new value.

$tagArr = explode(' ', $tag);$tag_sel = array_shift($tagArr);

In this case, the top error is lost, and the errors on the left and bottom still need to be removed by clicking clear cache in the ecshop background.

The following code also reports an error in php5.3 or later versions.

$file_suffix = strtolower(array_pop(explode('.', $file_name)));

Modification method:

$fnarray=explode('.', $file_name);$file_suffix = strtolower(array_pop($fnarray));

Now, you can understand it. In the future, you need to write the parameters separately. You cannot write a row.

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.