Community @ The Turning Gate

Support community for TTG plugins and products.

You are not logged in.

#1 2018-01-28 02:57:15

christian-berlin
Member
From: Berlin
Registered: 2016-11-24
Posts: 25
Website

Template export - php error

Hi!

For tests I try to copy my current running server. I make a clean new backlite installation (TTG Backlight version: 1.2.3 Rel4) on a different web server and thish works fine. Then I try to export the templates via "BacklightDesignerTemplatesBacklight Standard PageExport" but it not works. On the server I found these error message:

[Sat Jan 27 18:38:24 2018] [error] [client x.x.x.x] PHP Fatal error:  Call to undefined function mb_strlen() in /xx/xx/xx/x/backlight/designer/application/models/TemplateEntity.php on line 384, referer: http://www.gosslar.homedns.org/backligh … =1&p2=view

In the file TemplateEntity.php are these line:

                // change, added quotes to allow spaces in filenames, by Rajkumar Singh
                header('Content-Disposition: attachment; filename="'.$filename.'";' );
                header('Content-Transfer-Encoding: binary');
                header('Content-Length: '.mb_strlen($encoded, '8bit'));

If I remove the last line the export works fine.
The installed php version on the server is PHP Version 5.3.3

Is this problem only on my server or have anybody else these problem?

Christian

Offline

#2 2018-01-28 03:12:15

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 14,593
Website

Re: Template export - php error

I don’t have an answer for you, just some questions that might help Matt and Ben

You’re exporting templates from the old site (current server), correct?

Does this happen with all exports?
If not what kind of template were you exporting?
Page template
Album template
Album Set template
And are all of these Backlight 1.2.3 (Pangolin) templates or are any of these from Backlight 1.1 (Okapi)?

If an album template, what type of album?
Standard
Theater
Galleria
Client Response
Cart enabled


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Pangolin test site, Backlight 1.1.1 test site

Online

#3 2018-01-28 03:20:13

christian-berlin
Member
From: Berlin
Registered: 2016-11-24
Posts: 25
Website

Re: Template export - php error

>You’re exporting templates from the old site (current server), correct?

Yes, but the same error is seen on the new server

>Does this happen with all exports?

yes

>And are all of these Backlight 1.2.3 (Pangolin) templates or are any of these from Backlight 1.1 (Okapi)?

I try it with both templates, same result.

>If an album template, what type of album?

I try these:
Standard
Theater
Galleria
Pangolin

Christian

Offline

#4 2018-01-28 03:44:44

rod barbee
Moderator
From: Port Ludlow, WA USA
Registered: 2012-09-24
Posts: 14,593
Website

Re: Template export - php error

Ben is likely going to need admin access to Backlight. You can save some time by emailing him with those credentials and referencing this post.
http://community.theturninggate.net/profile.php?id=101


Rod 
Just a user with way too much time on his hands.
www.rodbarbee.com
ttg-tips.com, Pangolin test site, Backlight 1.1.1 test site

Online

#5 2018-01-28 04:13:31

christian-berlin
Member
From: Berlin
Registered: 2016-11-24
Posts: 25
Website

Re: Template export - php error

done, thanks!

Offline

#6 2018-01-28 06:44:02

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 3,520

Re: Template export - php error

Hi Christian, thanks for the access details.  Our code uses a PHP function called mb_strlen, which works out the length of multi-byte strings.   I assume that means text that includes characters outside the normal ASCII range (i.e.. outside a to z, 0-9 and other common characters) so including text with other types of characters.

Anyway, it turns out this function mb_strlen isn't installed by default on PHP installations, but typically is.  On your site, it isn't.

We normally check for the existence of the function before trying to use it, but failed to do so in this case. 

To temporarily fix this, can you edit the file backlight/modules/module-designer/application/models/TemplateEntity.php and change line 384 from this:

header('Content-Length: '.mb_strlen($encoded, '8bit'));

to this:

header('Content-Length: '.strlen($encoded));

That may well be our long-term solution, as I suspect that calling mb_strlen with '8bit' as our code currently does is no different from calling strlen.

Offline

#7 2018-01-28 06:51:27

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 3,520

Re: Template export - php error

Your site is running on PHP 5.3.3.  This was released over seven years ago.  The latest version of 5.3 was 5.3.29, released three years ago.
5.3 is no longer supported, so may very well have security risks.  I strongly suggest updating to the newest version of 5 that your host provides (which should be 5.6.something), or to PHP 7.

Offline

#8 2018-01-28 19:36:28

christian-berlin
Member
From: Berlin
Registered: 2016-11-24
Posts: 25
Website

Re: Template export - php error

Thanks a lot for the quick support. And also for the info about the php version. In the past I think, the centos update will update php if it run out of support. My mistakte. System is now on php 5.6.32. php7 will come if I must upgrade the server to centos7

Christian

Offline

#9 2018-01-31 20:54:20

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 3,520

Re: Template export - php error

Hi Christian, are you managing this server yourself?  I've found that the packaged version of PHP is really quite old for CentOS and Redhat.  It's only at 5.4 for version 7 of each..  So, you need to install PHP from third-party repositories to get something newer.  If somebody else is managing your server then I assume that's what they'd be doing.

Offline

#10 2018-02-01 04:05:11

christian-berlin
Member
From: Berlin
Registered: 2016-11-24
Posts: 25
Website

Re: Template export - php error

Hi Ben!

Yes, I manage the server by myself. php version is now 5.6.

Christian

Offline

#11 2018-02-01 06:36:14

Ben
Moderator
From: Melbourne, Australia
Registered: 2012-09-29
Posts: 3,520

Re: Template export - php error

Out of interest, which repository did you use to install 5.6?

Offline

#12 2018-02-05 03:48:05

christian-berlin
Member
From: Berlin
Registered: 2016-11-24
Posts: 25
Website

Re: Template export - php error

The php56w* comes from the repo webtatic.

yum repolist
Geladene Plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: centos.mirrors.as250.net
* epel: mirror.wiuwiu.de
* extras: centos.mirrors.as250.net
* updates: centos.mirrors.as250.net
* webtatic: sp.repo.webtatic.com
Repo-ID               Repo-Name:                                                                                       Status
base                    CentOS-6 - Base                                                                                   6.706
epel                     Extra Packages for Enterprise Linux 6 - x86_64                                      12.448
extras                   CentOS-6 - Extras                                                                                47
updates                CentOS-6 - Updates                                                                             945
webtatic               Webtatic Repository EL6 - x86_64                                                         194
repolist: 20.340

Last edited by christian-berlin (2018-02-05 03:49:43)

Offline

Board footer

Powered by FluxBB