This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Some questions about CT 2.1.19


avatar
Sobiech 77
From: -
I updated the CT 2.1.18 to 2.1.19, but I have some questions / problems (I have OVH VPS SSD 3 with Plesk 12.5 and PHP 5.4.45 / MySQL 5.6.34).

1. Do I have to use cadmin/cupgrade.php? When I try to use this, I have the following error:

 http://www.demka.pl/images/error.jpg

The same error occurs when I click:
Modules -> Update Module -> Files -> Submit

I updated all files in 5 patches and Contentteller looks good but cupgrade.php doesn't work for me.

2. When I change my version of PHP to 7.0.14 (fastcgi or php-fpm) teaserimages (files) are loaded at times slightly longer (in PHP 5.4.45 is OK).

When I open the browser address www.example.com/files/teaserimage/1 in PHP 5.4.45 looks like this:

 http://www.demka.pl/images/png1.jpg

and 7.0.14 in the fast-cgi / php-fpm like this:

 http://www.demka.pl/images/png2.jpg

Is it a problem with CT or server configuration?

With thumbnails and files (files/thumb and files/file), it seems that everything is OK.

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: Some questions about CT 2.1.19
avatar
Administrator
1340
From: Vienna, Austria
Just replace in both admindoaddnewfile.php/admindoeditfile.php the following code:

if( ( $file_type == "image/png" or $file_type == "image/x-png" or $file_type == "image/pjpeg" or $file_type == "image/jpeg" or $file_type == "image/gif" ) and function_exists( "imagecreatefromstring" ) )
{
if( $preferences[ 'files_image_teaserwidth' ] )
{
$teaserwidth = $preferences[ 'files_image_teaserwidth' ];
}
else
{
$teaserwidth = 20;
}

$teaser_image = $system -> resizeimage( $binary, $file_type, $teaserwidth, "", "", "" );
$teaser_size = strlen( $teaser_image );
$teaser_image = $database -> dbescape( $teaser_image );
}
else
{
$teaser_size = $file_size;
$teaser_image = $database -> dbescape( $binary );
}


with:
$teaser_size = filesize( $tmp_name );
$teaser_image = $database -> dbescape( $binary );
1 Re: Some questions about CT 2.1.19
avatar
OP 77
From: -
Thank you very much.

Option now runs in "Files" -> "Add Teaser image." Is it possible to include this function for the "Add New File" -> "Advance" -> "Teaser Image" and "File Management" -> "Edit" -> "Advance" -> "Teaser image"?

I think that I need to edit files: admindoaddnewfile.php (line 379) and admindoeditfile.php (line 345)? But there, the code looks a little different than in admindoaddfilesteaserimage.php.

Thank you again.
1 Re: Some questions about CT 2.1.19
avatar
Administrator
1340
From: Vienna, Austria
This should work with the following modification. Open /cadmin/files/admindoaddfilesteaserimage.php in an editor and replace:
            if( ( $file_type == "image/png" or $file_type == "image/x-png" or $file_type == "image/pjpeg" or $file_type == "image/jpeg" or $file_type == "image/gif" ) and function_exists( "imagecreatefromstring" ) )
{
$teaser_image = $system -> resizeimage( $binary, $file_type, $preferences[ 'files_image_teaserwidth' ], "", "" );
$teaser_size = strlen( $teaser_image );
$teaser_image = $database -> dbescape( $teaser_image );
}
else
{
$teaser_size = $file_size;
$teaser_image = $database -> dbescape( $binary );
}


with:

$teaser_size = filesize( $tmp_name );
$teaser_image = $database -> dbescape( $binary );
1 Re: Some questions about CT 2.1.19
avatar
OP 77
From: -
This is the last question ... Is it possible to teaserimages were not converted by GD Library (?) (during upload)? Eg. I have a png compressed file on hard disk (64x64px, size 2-3 KB), which after upload, is already 6-7 KB.
1 Re: Some questions about CT 2.1.19
avatar
OP 77
From: -
Thank you, this is a very good thing. I tried to fight with FastCGI / FPM on other server configurations.
1 Re: Some questions about CT 2.1.19
avatar
Administrator
1340
From: Vienna, Austria
Here another updated filesteaserimage.php. This update adds cache headers to the teaser images, so the browser will keep the images in the cache for one day.

Cached
   filesteaserimage.zip
1 Re: Some questions about CT 2.1.19
avatar
OP 77
From: -
Thank you for your reply. I tried several configurations for both FastCGI and FPM (eg. Forum Plesk or this from you) and it was the same or worse ...

Perhaps the fault of the VPS server. In my case, I think it would be best if images (as teaserimage) were taken from the file system as CSS and preferences Smiling Face.

Thank you for your answers and your time on this issue.
1 Re: Some questions about CT 2.1.19
avatar
Administrator
1340
From: Vienna, Austria
The link to the SQL dump is not working. I just checked your test site and noticed that the problem affect any request that goes through a PHP script:
Phpfpm

In this case both jquery.js and superfish.js response time was over 1 second.

There are two possibilities that can cause this:
1) The webserver or/and PHP configuration is not optimized. Both FastCGI and php-fpm have settings for the PHP processes. I don't know if Plesk has any option to change these settings?

I use the following FPM settings on my current test server (Apache 2.4/mod_fastcgi and PHP 7.1 FPM):

Phpfpmsettings

which work fine here:

Php71fpm

This is the same page but with all PHP-FPM settings set to 1 and memory reduced to 512MB RAM:
Phpfpm715l512
This make things a worse but all requests take still milliseconds.

2) The machine that hosts the VPS is sometimes busy. This can even happen on a fast machine when multiple customers are on the same machine.
1 Re: Some questions about CT 2.1.19
avatar
Administrator
1340
From: Vienna, Austria
I can try it on my local test server if you want. In this case create a dump of the database and send me a download link via PM
1 Re: Some questions about CT 2.1.19
avatar
OP 77
From: -
I can enable php-fpm.:
 http://programiki.pl/phpfpm7014.php

But teaserimage load here like in the FastCGI.
1 Re: Some questions about CT 2.1.19
avatar
Administrator
1340
From: Vienna, Austria
Is there an option to use php-fpm instead of FastCGI?
1 Re: Some questions about CT 2.1.19
avatar
Administrator
1340
From: Vienna, Austria
1) Do this happens on random image files or is it always the same file?

2) PHP 5.4.45 is running as Apache module and PHP 7 in FastCGI? Can you post phpinfo pages from both configuration?
1 Re: Some questions about CT 2.1.19
avatar
OP 77
From: -
Thank you, I updated the system using cupgrade.php (without errors Smiling Face). What version number should be in build.php? In build.php I still have 824,991 (this file is writable). In control panel says: ContenttellerĀ® Professional Edition 2.1.19 Grinning Face.

--------------------

I thought that the problem of teaserimage no longer exists, but I think, however, continues to be somewhat slower. This problem is not large and often, but it is.

I have installed an additional mod_pagespeed, so it rewrites teaserimages and then they are downloaded from the cache (and everything works normally).

Unfortunately, mod_pagespeed doesn't rewrite files from the database (only files from the file system), when I am using https.

The following pictures show how to display teaserimage in various configurations (timeline):

PHP 5.4.45 Apache by Apache (http and https + mod_pagespeed on/off), PHP 7.0.14 FastCGI by Apache (http + mod_pagespeed on)
 http://www.demka.pl/images/fast.jpg

PHP 7.0.14 FastCGI by Apache or FPM by Nginx (http + mod_pagespeed off, https + mod_pagespeed on/off)
 http://www.demka.pl/images/slow.jpg

The problem is not large, but it is, and I do not know what is causing it Slightly Frowning Face.

Theoretically, I could use https and PHP 5.4.45 (Apache by Apache in Plesk Panel), then everything works quickly, but I would like, to use PHP 7 (FastCGI by Apache).
1 Re: Some questions about CT 2.1.19
avatar
Administrator
1340
From: Vienna, Austria
The control panel displays the version 2.1.18 and I remember that I did the update from 2.1.16 and now I try to upgrade from 2.1.18 to 2.1.19.

For some reason the build.php file didn't update previously, so the installer thought that you are still running version 2.1.16.

To fix this for future updates, just change the $install_build line in build.php:
$install_build = "824.991";
1 Re: Some questions about CT 2.1.19
avatar
OP 77
From: -
EDIT: Now, even if "short_open_tag" is disable, the filesteaserimage works fine. Thanks!

I thought that this option causes an error, but did not. The most important for me is that now everything works fine Smiling Face.
1 Re: Some questions about CT 2.1.19
avatar
OP 77
From: -
install_build = 824.97

When I click cupgrade.php displays such a thing:
"Welcome to the upgrade script for Contentteller CMS. This script will upgrade your current Contentteller installation from version 2.1.16 to build 824.991"

The control panel displays the version 2.1.18 and I remember that I did the update from 2.1.16 and now I try to upgrade from 2.1.18 to 2.1.19.

The updatemodule for files and content returns an error:
The MySQL database server has returned 1060: Duplicate column name 'contentfile_status' while executing ALTER TABLE esselbach_ct_contentfiles ADD contentfile_status tinyint(1) default '0' AFTER contentfile_inuse


The MySQL database server has returned 1060: Duplicate column name 'filefile_status' while executing ALTER TABLE esselbach_ct_filesfiles ADD filefile_status tinyint(1) default '0' AFTER filefile_inuse



Anyway, I updated all files from the patches and Contentteller works fine (with erorr 404 patches, https, php 7).

---------------

I sent the file filesteaserimage.php and I think is better, but loading is still slower (not for all and not always - sometimes). I found in the plesk panel function "short_open_tag" - in the PHP 5.4.45 this option is enabled by default, but in PHP 7.0.14 is disabled by default. I tried to turn on this option and now teaserimages load without a problem Smiling Face.
1 Re: Some questions about CT 2.1.19
avatar
Administrator
1340
From: Vienna, Austria
1. Do I have to use cadmin/cupgrade.php?

Can you post the output of /includes/build.php?
1 Re: Some questions about CT 2.1.19
avatar
Administrator
1340
From: Vienna, Austria
Here an updated filesteaserimage.php. You need to place it into the /modules/files directory.

Does this fix the performance issue with the teaser images?
   filesteaserimage.zip
1 Re: Some questions about CT 2.1.19
avatar
Administrator
1340
From: Vienna, Austria
1. Do I have to use cadmin/cupgrade.php? When I try to use this, I have the following error:

Yes, but it is not necessary after there are no database updates at all. I will look into the error with cupgrade.php. Could be an issue in the upgrade script.

2. When I change my version of PHP to 7.0.14 (fastcgi or php-fpm) teaserimages (files) are loaded at times slightly longer (in PHP 5.4.45 is OK).

Interesting. I will look into it as well.

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.