{"id":199377,"date":"2025-05-03T13:25:36","date_gmt":"2025-05-03T05:25:36","guid":{"rendered":"https:\/\/server.hk\/cnblog\/199377\/"},"modified":"2025-05-03T13:25:36","modified_gmt":"2025-05-03T05:25:36","slug":"php5-6-6%e4%b8%8a%e8%bf%90%e8%a1%8c-ecshop-2-7-3%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e6%95%b4%e5%90%88","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/199377\/","title":{"rendered":"PHP5.6.6\u4e0a\u8fd0\u884c ecshop 2.7.3\u5e38\u89c1\u95ee\u9898\u6574\u5408"},"content":{"rendered":"<p> ecshop\u5728\u5728PHP5.6.6\u7248\u672c\u4ee5\u540e\uff0c\u6709\u4e86\u5f88\u591a\u7ec6\u5fae\u7684\u53d8\u5316\u3002\u800cECSHOP\u5b98\u65b9\u66f4\u65b0\u53c8\u592a\u6162\uff0c\u53d1\u73b0\u8fd9\u4e9b\u95ee\u9898\u540e\u4e5f\u4e0d\u53ca\u65f6\u5347\u7ea7\uff0c\u5bfc\u81f4\u7528\u6237\u5b89\u88c5\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u9519\u8bef\u767e\u51fa\u3002<\/p>\n<p> \u597d\u6a21\u677f\u6574\u7406\u4e00\u4e0b\u6211\u9047\u5230\u7684\u95ee\u9898\u5e0c\u671b\u5bf9\u4f60\u4eec\u80fd\u6709\u4e9b\u5e2e\u7ec4\u4e5f\u4e3a\u4e86\u81ea\u5df1\u4ee5\u540e\u67e5\u770b\u3002<\/p>\n<p> \u95ee\u98981:&nbsp; &nbsp; &nbsp;<\/p>\n<p> &nbsp; Deprecated: preg_replace(): The \/e modifier is deprecated, use preg_replace_callback instead in cls_template.php XXX line<\/p>\n<p> \u51fa\u9519\u539f\u56e0:<\/p>\n<p> &nbsp;&nbsp;&nbsp;\u51fa\u73b0\u4ee5\u4e0a\u95ee\u9898\u662f&nbsp;preg_replace() \u51fd\u6570\u4e2d\u7528\u5230\u7684\u4fee\u9970\u7b26 \/e \u5728 PHP5.5.x \u4e2d\u5df2\u7ecf\u88ab\u5f03\u7528\u4e86\u3002\u5728PHP 5.5\u4ee5\u4e0a\u7684\u7248\u672c\u7528 preg_replace_callback \u51fd\u6570\u66ff\u6362\u4e86 preg_replace\u51fd\u6570\u3002<\/p>\n<p> \u89e3\u51b3\u65b9\u6cd5:<\/p>\n<p> \u3000\u89e3\u51b3\u95ee\u9898\u7684\u65b9\u6cd5\u5c31\u662f\u5c06\u4ee3\u7801\u4e2d\u4f7f\u7528 preg_replace \u51fd\u6570\u7684\u90e8\u5206\u5168\u90e8\u66ff\u6362\u6210 preg_replace_callback \u51fd\u6570\uff0c\u5e76\u4e14\u5c06\u4e00\u88ab\u5e9f\u5f03\u7684 \/e \u4fee\u9970\u7b26 \u5220\u9664\u3002&nbsp;<\/p>\n<p> \u4f8b\u5b50:&nbsp;<\/p>\n<p> &nbsp; &nbsp;return preg_replace(&#8220;\/{([^\\}\\{\\n]*)}\/e&#8221;, &#8220;\\$this-&gt;sel ect(&#8216;\\\\1&#8217;);&#8221;, $source);&nbsp;<\/p>\n<p> &nbsp; &nbsp;\u66ff\u6362\u4e3a<\/p>\n<p> &nbsp; &nbsp;return preg_replace_callback(&#8220;\/{([^\\}\\{\\n]*)}\/&#8221;, function($r) { return $this-&gt;sel ect($r[1]); }, $source);<\/p>\n<p> &nbsp;<\/p>\n<p> \u95ee\u98982:<\/p>\n<p> &nbsp; &nbsp;Strict Standards: Only variables should be passed by reference in&nbsp;&#8230;&#8230;\\includes\\cls_template.php&nbsp;on line&nbsp;418<\/p>\n<p> \u51fa\u9519\u539f\u56e0:<\/p>\n<p> &nbsp; &nbsp;\u51fa\u73b0\u8fd9\u4e2a\u95ee\u9898\u7684\u539f\u56e0\uff0c\u8c8c\u4f3c\u5728php5.4\u4e2darray_shift\u53ea\u80fd\u4e3a\u53d8\u91cf\uff0c\u4e0d\u80fd\u662f\u51fd\u6570\u8fd4\u56de\u503c\u3002<\/p>\n<p> \u89e3\u51b3\u65b9\u6cd5:<\/p>\n<p> &nbsp; &nbsp;$tag_sel = array_shift(explode(\u2018 \u2018, $tag));<\/p>\n<p> &nbsp; &nbsp;\u66ff\u6362\u6210<\/p>\n<p> &nbsp; &nbsp;$tag_arr = explode(\u2018 \u2018, $tag);<br \/> &nbsp; &nbsp;$tag_sel = array_shift($tag_arr);<\/p>\n<p> &nbsp;<\/p>\n<p> \u95ee\u98983:&nbsp;<\/p>\n<p> &nbsp; &nbsp;Strict Standards: Non-static method cls_image::gd_version() should not be called statically in&nbsp;&#8230;&#8230;\\includes\\lib_base.php&nbsp;on line&nbsp;346 &nbsp; \u6216\u8005<\/p>\n<p> &nbsp; &nbsp;Strict Standards: Non-static method cls_image::gd_version() should not be called statically in &#8230;&#8230;\\includes\\lib_installer.php on line 31<\/p>\n<p> \u51fa\u9519\u539f\u56e0: &nbsp;<span style=\"color:#ffffff\">\/\/www.ldhost.cn<\/span><\/p>\n<p> &nbsp; &nbsp;\u5982\u95ee\u9898\u4e2d\u63d0\u793a\u7684\u4e00\u6837\uff0c\u56e0\u4e3a cls_image.php \u4e2d gd_version() \u4e0d\u662f static \u51fd\u6570\u6240\u4ee5\u5728lib_base.php \u4e0e lib_installer.php \u4e2d\u8c03\u7528\u65f6\u624d\u4f1a\u51fa\u73b0\u4ee5\u4e0a\u95ee\u9898\u3002<\/p>\n<p> \u89e3\u51b3\u65b9\u6cd5:<\/p>\n<p> \u3000 \u89e3\u51b3\u65b9\u6cd51: &nbsp;&nbsp;&nbsp;\u9996\u5148\u5728 lib_image.php \u6587\u4ef6\u4e2d\uff0c\u7528 Shift+F \u53bb\u641c\u7d22 gd_version \u51fd\u6570\u3002\u7136\u540e\u5728gd_version \u65b9\u6cd5\u524d\u52a0 static \u4fee\u9970\u7b26\uff0c\u662f\u6b64\u51fd\u6570\u53d8\u6210\u9759\u6001\u51fd\u6570\u3002<\/p>\n<p> &nbsp; &nbsp; \u89e3\u51b3\u65b9\u6cd52: &nbsp; &nbsp;\u5728lib_base.php \u4e0e lib_installer.php \u51fd\u6570\u4e2d\u627e\u5230 cls_image::gd_version() \u90e8\u5206, \u7136\u540e\u5206\u522b\u521b\u5efacls_image \u5b9e\u4f8b\uff0c\u4e4b\u540e\u7528\u521b\u5efa\u7684\u5b9e\u4f8b\u518d\u53bb\u8c03\u7528 gd_version() \u51fd\u6570\u3002<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $cls_gile = new cls_image();<\/p>\n<p> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return $cls_gile-&gt;gd_version();<\/p>\n<p> &nbsp;<\/p>\n<p> \u95ee\u98984:<\/p>\n<p> &nbsp; &nbsp;Deprecated: Assigning the return value of new by reference is deprecated in\u2026<\/p>\n<p> \u51fa\u9519\u539f\u56e0:<\/p>\n<p> &nbsp; &nbsp;PHP5.3+\u5e9f\u9664\u4e86\u201d=&amp;\u201d\u7b26\u53f7\uff0c\u5bf9\u8c61\u590d\u5236\u7528\u201d=\u201d<\/p>\n<p> \u89e3\u51b3\u65b9\u6cd5:<\/p>\n<p> &nbsp; &nbsp;\u641c\u7d22\u6240\u6709PHP\u6587\u4ef6\uff0c\u5c06\u201d=&amp;\u201d\u66ff\u6362\u4e3a\u201d=\u201d<\/p>\n<p> \u95ee\u98985:<\/p>\n<p> &nbsp; &nbsp;Strict Standards: mktime(): You should be using the time() function instead in &#8230;&#8230;\\admin\\shop_config.php on line 32<\/p>\n<p> \u51fa\u9519\u539f\u56e0:<\/p>\n<p> &nbsp; &nbsp;\u8fd9\u4e2a\u9519\u8bef\u63d0\u793a\u7684\u610f\u601d\uff1amktime()\u65b9\u6cd5\u4e0d\u5e26\u53c2\u6570\u88ab\u8c03\u7528\u65f6\uff0c\u4f1a\u88ab\u629b\u51fa\u4e00\u4e2a\u62a5\u9519\u63d0\u793a\u3002<\/p>\n<p> \u89e3\u51b3\u65b9\u6cd5:<\/p>\n<p> &nbsp; &nbsp;$auth = mktime();<\/p>\n<p> &nbsp; &nbsp;\u5c06mktime()\u66ff\u6362\u6210time()\u65b9\u6cd5\uff0c\u4ee3\u7801\u4e3a\uff1a<\/p>\n<p> &nbsp; &nbsp;$auth = time();<\/p>\n<p> &nbsp;<\/p>\n<p> \u95ee\u98986:<\/p>\n<p> &nbsp; &nbsp;Strict Standards: Redefining already defined constructor for class cls_sql_dump &#8230;&#8230;<\/p>\n<p> \u51fa\u9519\u539f\u56e0:<\/p>\n<p> &nbsp; &nbsp;\u539f\u56e0\u8ddfPHP\u7c7b\u4e2d\u7684\u6784\u9020\u51fd\u6570\u6709\u5173\uff0cPHP\u65e9\u671f\u7248\u672c\u662f\u4f7f\u7528\u8ddf\u7c7b\u540c\u540d\u7684\u51fd\u6570\u4f5c\u4e3a\u6784\u9020\u51fd\u6570\uff0c\u540e\u6765\u53c8\u51fa\u73b0\u4e86\u4f7f\u7528 __construct()\u4f5c\u4e3a\u6784\u9020\u51fd\u6570\uff0c<\/p>\n<p> &nbsp; &nbsp;\u8fd9\u4fe9\u4e2a\u51fd\u6570\u53ef\u4ee5\u540c\u65f6\u5b58\u5728\u3002\u5230\u4e86PHP5.4\u7248\u672c\uff0c\u5bf9\u8fd9\u4fe9\u4e2a\u51fd\u6570\u5728\u4ee3\u7801\u4e2d\u7684\u5148\u540e\u987a\u5e8f\u6709\u4e86\u4e25\u683c\u7684\u8981\u6c42\u3002\u5728PHP5.4\u7248\u672c\u4e0b\uff0c\u5fc5\u987b__construct() \u5728\u524d\uff0c<\/p>\n<p> &nbsp; &nbsp;\u540c\u540d\u51fd\u6570\u5728\u540e\uff0c\u5426\u5219\u5c31\u4f1a\u51fa\u73b0\u4e0a\u9762\u7684\u7684\u9519\u8bef\u63d0\u793a\u3002<\/p>\n<p> \u89e3\u51b3\u65b9\u6cd5:<\/p>\n<p> &nbsp; &nbsp;\u628a__construct()\u51fd\u6570\u653e\u5728\uff0c\u540c\u540d\u51fd\u6570\u4e0a\u9762\u5c31\u884c\u4e86\u3002<\/p>\n<p> &nbsp;<\/p>\n<p> \u95ee\u98987:<\/p>\n<p> &nbsp; &nbsp;Strict Standards: Declaration of vbb::set_cookie() should be compatible with integrate::set_cookie($username = &#8221;, $remember = NULL)<\/p>\n<p> \u51fa\u9519\u95ee\u9898:<\/p>\n<p> &nbsp; &nbsp;vbb\u7ee7\u627f\u4e86integrate\u7c7b\u5e76\u4e14\u91cd\u5199\u4e86 set_cookie() \u51fd\u6570\uff0c\u4f46vbb\u91cd\u5199set_cookie\u51fd\u6570\u7684\u53c2\u6570 \u4e0e \u5176\u7236\u7c7bset_cookie \u7684\u53c2\u6570\u4e0d\u7b26\u6240\u4ee5\u51fa\u73b0\u4ee5\u4e0a\u95ee\u9898\u3002<\/p>\n<p> \u89e3\u51b3\u65b9\u6cd5:<\/p>\n<p> &nbsp; &nbsp;function set_cookie ($username=&#8221;&#8221;)<br \/> &nbsp; &nbsp;\u6539\u4e3a<br \/> &nbsp; &nbsp;function set_cookie ($username=&#8221;&#8221;, $remember = NULL)<\/p>\n<p> &nbsp; &nbsp;\u5982\u51fa\u73b0\u7c7b\u4f3c\u9519\u8bef\uff0c\u53ef\u4ee5\u4ee5\u540c\u6837\u7684\u65b9\u6cd5\u89e3\u51b3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ecshop\u5728\u5728PHP5.6.6&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4925],"tags":[],"class_list":["post-199377","post","type-post","status-publish","format-standard","hentry","category-4925"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199377","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=199377"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/199377\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=199377"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=199377"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=199377"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}