Post by WaxedPerfection » Thu May 25, 2017 2:11 am

Hi All,

really need some help with this one, since this morning been getting the following error.

Fatal error: Call to undefined function utf8_substr() in /home/waxplane/public_html/catalog/model/tool/image.php on line 11

im just stick on what to do to fix it, had a good look around good and found a couple of posts but sadly with no solutions.

OpenCart © 2009-2017 All Rights Reserved.
Version 2.2.0.0

https://www.waxedperfection.co.uk/ Car Detailing Product Blog's and Review's


Active Member

Posts

Joined
Sun Mar 26, 2017 8:23 pm

Post by IP_CAM » Thu May 25, 2017 8:53 am

Line 11 in default OC 2.2.0.0 is:

Code: Select all

$new_image = 'cache/' . utf8_substr($filename, 0, utf8_strrpos($filename, '.')) . '-' . $width . 'x' . $height . '.' . $extension;
and this _substr is the 'command' to 'shorten' the image titel to max-set/defined value.
So, my guess, the error message could possibly mean, that some image(s) use(s) an image name,
'utf8_' cannot handle. It could also be the overall lenght of a Title, exeeding http-allowed limits, but I
could be far off, as well... :D
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by artcore » Thu May 25, 2017 3:05 pm

Undefined means it doesn't exist (even if you believe it does :)). Ask your host to install mbstring php extention or change utf8_substr to just substr and make sure your image filenames don't have 'strange' characters

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by uksitebuilder » Thu May 25, 2017 3:11 pm

Most likely means the helper file utf8.php is missing from system/helpers directory or the help include code has been changed / removed to no longer include that helper file in system/startup.php

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by artcore » Thu May 25, 2017 5:06 pm

That helper starts with if (extension_loaded('mbstring')) { which is probably false. That's why the utf8_ functions don't exist.
The webhost has to install it for you if you're on shared hosting

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands

Post by WaxedPerfection » Fri May 26, 2017 2:45 am

artcore wrote:
Thu May 25, 2017 5:06 pm
That helper starts with if (extension_loaded('mbstring')) { which is probably false. That's why the utf8_ functions don't exist.
The webhost has to install it for you if you're on shared hosting
Thank you and you are correct the host updated there server today and needed to install the module thank you for your help

https://www.waxedperfection.co.uk/ Car Detailing Product Blog's and Review's


Active Member

Posts

Joined
Sun Mar 26, 2017 8:23 pm

Post by artcore » Fri May 26, 2017 4:32 am

You're welcome, good you got it solved!

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands
Who is online

Users browsing this forum: No registered users and 70 guests