Loading...
 
Architecture / Installation

Architecture / Installation


TikiWiki 6 and PHP compatiblity

posts: 24

Hello,
At the moment are using a website based on TikiWiki 6.* LTS. Our web host has upgraded the PHP version to 5.4.25. This seems to cause problems with the display of images. The following are some of the error messages:

PHP Strict Standards: Declaration of Image::rotate() should be compatible with ImageAbstract::rotate() in .../lib/images/gd.php on line 11

PHP Strict Standards: Non-static method Image::is_supported() should not be called statically in .../tiki-download_file.php on line 262
PHP Strict Standards: Only variables should be assigned by reference in .../tiki-download_file.php on line 332

PHP Warning: Cannot modify header information - headers already sent by (output started at .../lib/images/gd.php:11) in .../tiki-download_file.php on line 361

Although we wish to upgrade in the future to TikiWiki 9.* LTS we'd hope to do this when ready. Is there anything that can be done to TikiWiki 6.* to make it co-exist with PHP 5.4.25.
Thanks Peter

posts: 214

I think the error messages are displayed because there was a change in the error reporting levels in PHP when you went to PHP 5.4.

From: http://php.net/manual/en/function.error-reporting.php
5.4.0 E_STRICT became part of E_ALL.

In Admin Home, General, General Preferences tab, what do you have the "PHP Error reporting level" set to?
If you set it to "Report all PHP errors except strict" (or "No error reporting"), does that remove the error messages?

I installed a Tiki version 6 on a PHP 5.5 system and I can not recreate the error. But if you search Google for the error, you will find LOTS of Tiki sites have this problem.

When your host upgraded PHP, did they search out all their customer's php.ini files and upgrade them too?

Tom

posts: 24

Hello,
Interesting that you have a Tiki 6 on PHP 5.5. I have the option set to "No error reporting". Generally all seems to work ok. The specific problem I'm currently having is the display of thumbnails from the image gallery.
Previously we have pages that displayed images inline and then clicking on the would cause them to be displayed in a pop-up box thus {img fileId="184" thumb="y" alt="" rel="box[g]"} . However for some reason the inline display now fails although the pop-up box is ok.
Rightly or wrongly the impression I've formed and also suggested by the host provider is that this is because there is a problem with the version of PHP. The errors quoted above all seem to be related to the image functions or gd library.
Is this something your version has a problem with? Is there something I can do to fix this?

What I think the host has done is to move us to a new server with a new PHP version. So I'm guessing they've sorted out the php.ini files. We don't have access to those.

Thanks Peter
PS I've tried upgrading to 6.14 but this doesn't seem to get rid of the errors.


posts: 214

I only did an svn install of Tiki 6 (6.15) on a system with PHP 5.5 to try and recreate your problem.

Are you sure GD Graphics Library is installed on the new server? Go to Admin -> phpinfo and check the "GD Support" (hopefully it says enabled) and "GD Version".

GD dynamically generates the thumbnails from the original image (not like the old Image Gallery where a separate thumbnail was generated and kept). If GD is not available, that would cause the problem you are having.

Tom

posts: 24

Hello,
Thanks for the help. I've run phpinfo and get the following

GD Support enabled

GD Version bundled (2.1.0 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.3.11
GIF Read Support enabled
GIF Create Support enabled
JPEG Support enabled
libJPEG Version 6b
PNG Support enabled
libPNG Version 1.2.49
WBMP Support enabled
XPM Support enabled
libXpm Version 30411

XBM Support enabled

Does that offer any clues?
Thanks again Peter


posts: 214

I have done some more searches on Google, and there does appear to be reports of problems with some PHP 5.4 versions and LibGD 2.1.0, but nothing definite.

To be more specific about your problem, the thumbnails show as the broken image icons, but clicking on them brings them up in the popup box with the image displayed correctly? If that is the case, then it does sound like a problem with GD, because GD generates the thumbnail.

Does you host have any other sites reporting problems with GD?

Can you check if Image Magick is available for you to use, instead of GD?

This would not change anything, but you could use phpmyadmin to browse the tiki_preferences table and verify that the row with column `name` = 'gal_use_lib' has the column `value` = 'gd'. That would have been set at installation time when you specified to use GD.

And I do not know if this will help, but you can download the code for tiki-check.php and install it on your site and run it. The tiki-check.php has not been added to Tiki 6, but it will run and give you more information about your server settings.
https://svn.code.sf.net/p/tikiwiki/code/branches/9.x/tiki-check.php

Sorry I can not find anything to help you.

Tom


posts: 24

Hello,
Thanks. Yes you have correctly summerised the problem.

I don't know that they have problems with other sites but their responses would suggest that it's not something they're expecting. On seeing the errors they put it down to PHP errors from a old "platform" rather than something to do with GD etc.

I've run the tiki-check. It concludes that I do not have access to Image Magick. There's nothing that stands out to me as being a problem with the GD configuration.

Thanks for your help
Peter


posts: 1 United States
very informative post,thank you

Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting