Firefox PHP

All uploaded images broken after the upgrade

Posted by CBiLL 
All uploaded images broken after the upgrade
September 02, 2013 04:00AM
After upgrading from MySQL 5 to 5.5 because 5 will be EOL on Dec 31 of this year, all of the posting images and avatars image are showing broken.

I don't know why or what caused this. Event loggers not giving us any helpful information. I am using Store on Disk module and all the files are still on disk.

In the embedded image module, it stated that download test is NOT OK ... I know we have not touch the firewall or anything else just upgraded the MySQL and suddenly it NOT OK .

Can anyone help us restore the images on our Phorum?

Thank you

Bill
Re: All uploaded images broken after the upgrade
September 02, 2013 07:11AM
Strange the image is barely visible but distorted however it still showing as broken image

Here one avatar link

[www.stlaware.com]


Does it show up or broken to you?

Bill
Re: All uploaded images broken after the upgrade
September 02, 2013 09:02AM
I managed to fix it.

When I upgraded MySQL to 5.5, I recompiled my Apache for the upgraded MySQL but it also upgraded my php from 5.3.27 to 5.4.19 which broke all the images across all my Phorums.

I recompiled Apache again going back to php 5.3.27 and all my images in Phorum were restored and working again.

It seem Phorum is not compatible with php 5.4.19 because all images in our other php scripts were working fine but the images in Phorum script was broken.

Bill
Re: All uploaded images broken after the upgrade
September 02, 2013 09:09AM
Yeah, and only upgraded mysql ;).

Well, if at all its a problem with the embed_images module.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting




Edited 1 time(s). Last edit at 09/02/2013 09:10AM by Thomas Seifert.
Re: All uploaded images broken after the upgrade
September 02, 2013 09:12AM
Hi Bill,

please have a look here: Module Tidy Output is corrupting avatar images.

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: All uploaded images broken after the upgrade
September 02, 2013 09:15AM
Quote
Thomas Seifert
Yeah, and only upgraded mysql ;).

Well, if at all its a problem with the embed_images module.

I turned off the embed_image module which it did not fix it.

When I downloaded the image using the download link in the post after disabling the module, I couldn't open the image locally and it gave me an "Decode error" message.

Bill
Re: All uploaded images broken after the upgrade
September 02, 2013 09:16AM
Hi Bill,

you have to disable the Tidy Output Module...

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: All uploaded images broken after the upgrade
September 02, 2013 09:22AM
Quote
Oliver Riesen
Hi Bill,

you have to disable the Tidy Output Module...

Regards
Oliver

Your saying that module was causing my problem with the images in Phorum after I upgraded php

I will have to look into this, thank you for sharing.

Can you explain why you think this module was causing this issue?

Thank you

Bill
Re: All uploaded images broken after the upgrade
September 02, 2013 09:26AM
Hi Bill,

Quote
CBiLL
Can you explain why you think this module was causing this issue?

Module Tidy Output is corrupting avatar images

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: All uploaded images broken after the upgrade
September 02, 2013 09:28AM
Quote
Oliver Riesen
Hi Bill,

please have a look here: Module Tidy Output is corrupting avatar images.

Regards
Oliver


Thank for pointing it out. I have disabled that module for now and I will try upgrading php again soon. Right now I am gonna sit back and take a breather because I thought I was gonna have to do a whole system wide restore from backup.


Bill
Re: All uploaded images broken after the upgrade
September 02, 2013 09:33AM
Nevertheless we need a fix for common.php ...


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: All uploaded images broken after the upgrade
September 02, 2013 02:41PM
Just for the record, I did not have Mody Tidy Output enabled, because it caused a conflict with Mod PDF Pages.


Robert Angle
Phorum lover, nothing more.
Ruminations
Re: All uploaded images broken after the upgrade
September 02, 2013 03:45PM
About 3 weeks ago: On my test machine, I was testing restoring a backup after upgrading phorum to 5.2.19, php to the latest version (on that date; probably 5.5.1) and mysql 5.6.1.

It broke all of the images. I did not report the problem due to the many things I changed at once, and my fight with Windows to get php and mysql working again. I also have not returned to the issue yet.


I do not use the Tidy mod, I do not believe it is involved.
Re: All uploaded images broken after the upgrade
September 02, 2013 03:51PM
Quote
Scott Finegan
I do not use the Tidy mod, I do not believe it is involved.

I think, that every module which uses "ob_start" together with phorum_api_file_retrieve (file.php) is involved...


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: All uploaded images broken after the upgrade
September 02, 2013 07:21PM
Quote
Scott Finegan
About 3 weeks ago: On my test machine, I was testing restoring a backup after upgrading phorum to 5.2.19, php to the latest version (on that date; probably 5.5.1) and mysql 5.6.1.

It broke all of the images. I did not report the problem due to the many things I changed at once, and my fight with Windows to get php and mysql working again. I also have not returned to the issue yet.


I do not use the Tidy mod, I do not believe it is involved.

Try turning off all the modules and see if it restores your images in the Phorum.

If your image is working again, then turn the module back on one at a time.

Otherwise you probably will have to stay with an older version php like me to have a working Phorum until someone fix this issue in Phorum or Module. I am still not even sure why this is happening with newer php version.


Bill
Re: All uploaded images broken after the upgrade
September 03, 2013 04:12AM
Bill,

Turning off all modules did not correct the problem. With all modules disabled... rather than get an embedded "broken image", I select a link for "Open | Download" and receive a "The page cannot be found." 404 , from IIS.

If you look at the URL htt p://127.0.0.1/5214a/file.php/download/1/2275/1916.jpg the reason is obvious. Instead of running file.php and processing what comes after, it is looking for the 1916.jpg in a nonexistent directory


At this point only my test machine doesn't work correctly.

The hosting provider is running php 5.2.17. Any day now, the host will upgrade php without notice, so I thought I would test :( and see what happens.
Re: All uploaded images broken after the upgrade
September 03, 2013 07:11AM
thats the setting for "Put file name in pathinfo for file download URLs" which changes the url for webservers not working correctly with it.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: All uploaded images broken after the upgrade
September 09, 2013 05:34PM
Is it a problem that need to be fix in Phorum before we can upgrade to php 5.4?

Bill
Re: All uploaded images broken after the upgrade
September 10, 2013 07:09PM
Bill,

Try turning off "Debug" in the embed images module, then test again.
Re: All uploaded images broken after the upgrade
September 11, 2013 07:49PM
Quote
Scott Finegan
Bill,

Try turning off "Debug" in the embed images module, then test again.

It off, I never had it enabled before.

I can't test again because it was a pain in the butt to downgrade php and recompile everything. I used to have a test server so I probably will have to dust it off and do some testing on it.

Bill
Re: All uploaded images broken after the upgrade
September 15, 2013 02:28AM
Change to common.php in line 2175 to
!isset($status['del'])) break;
Re: All uploaded images broken after the upgrade
September 15, 2013 05:03PM
Here a patch for mod_tidy
its necesarry to enable php_fileinfo. It should be enabled by default in PHP > 5.3

At Row 13 add following lines

function mod_tidy_end($buffer) {

if(function_exists("finfo_open")) {
$finfo = finfo_open(FILEINFO_MIME);
$mimetype = finfo_buffer($finfo, $buffer);
error_log($mimetype);
if (strpos('text', $mimetype) === false)
return $buffer;
}
Re: All uploaded images broken after the upgrade
October 03, 2013 06:59AM
Quote
lara_19800
Quote
CBiLL
I managed to fix it.

When I upgraded MySQL to 5.5, I recompiled my Apache for the upgraded MySQL but it also upgraded my php from 5.3.27 to 5.4.19 which broke all the images across all my Phorums.

I recompiled Apache again going back to php 5.3.27 and all my images in Phorum were restored and working again.

It seem Phorum is not compatible with php 5.4.19 because all images in our other php scripts were working fine but the images in Phorum script was broken.

Bill
Try turning off "Debug" in the embed images module, then test again.

Read the previous post, somesone suggest that to me and I posted that it was never enabled. It always been off.


Bill



Edited 1 time(s). Last edit at 12/05/2013 10:27AM by Oliver Riesen.
Re: All uploaded images broken after the upgrade
January 09, 2014 01:53PM
In file.php you can add a line

while(ob_get_level()) ob_end_clean();

before

$flags = empty($PHORUM['args']['download'])
? 0 : PHORUM_FLAG_FORCE_DOWNLOAD;
phorum_api_file_send($file, $flags);
Re: All uploaded images broken after the upgrade
June 01, 2014 05:49AM
Have this issue been resolved yet?

I just finally gotten around to setting up a test server and upgraded the PHP which it broke all the images in the post.

I will try those common.php and file.php hack to see if it fixes.

BIll
Re: All uploaded images broken after the upgrade
June 01, 2014 05:59AM
Tidy is disabled

It did not restore the images

Bill
Re: All uploaded images broken after the upgrade
June 01, 2014 05:59AM
Quote
bandlow
Change to common.php in line 2175 to
!isset($status['del'])) break;

I tried this hack ... It did not fix or restore the images in the forum.


Bill
Re: All uploaded images broken after the upgrade
June 01, 2014 06:04AM
Quote
olii
In file.php you can add a line

while(ob_get_level()) ob_end_clean();

before

$flags = empty($PHORUM['args']['download'])
? 0 : PHORUM_FLAG_FORCE_DOWNLOAD;
phorum_api_file_send($file, $flags);


This hack did not restore or fix the images issue.

Bill
Re: All uploaded images broken after the upgrade
June 02, 2014 02:05AM
If any of the Phorum developer would like access to my test server to troubleshoot this, send me a PM and I'll set you up an server admin account.

Right I am unable to get any of the images to work in PHP 5.4 or higher and I need to get it working because PHP 5.3 suppose to be end of life in July.

I am willing to try anything to get this working in PHP 5.4 or higher.

Thank you

Bill
Re: All uploaded images broken after the upgrade
June 02, 2014 04:06PM
Hi Bill,

Try setting...
Language: PHP
error_reporting(-1); or error_reporting(E_ALL);

see [www.php.net]

Language: PHP
run phpinfo(); on both installs and compare the output. or php -i on the command line and redirect to a file

... you are looking for missing GD, mbstring, Zip etc.
Sorry, only registered users may post in this forum.

Click here to login