Forums

Captcha image does not show after upgrade to php 5.3.6 :(

Rani 02 Apr, 2011
Hi, guys
I have run into strange situation yesterday after have been done an major upgrade to important packages into my system (FreeBSD 8.1 stable). I have just upgraded mysql-server, mysql-client, phpMyAdmin, php5-5.3.5->php5-5.3.6. I have upgraded all php5-extentions, including gd libraries. I did not touch any file permissions into com_chronocoments, any httpd.conf parameters, any php.ini parameters.

into my pages i can see the comments but my captcha image does not show up; digging into source code i saw that all my captcha imtype are 0:

...
<img id="comment_captcha_img" class="comment_captcha_img" src="http://www.ziarulancheta.ro/components/com_chronocomments/chrono_verification.php?imtype=0&anticache=61835">
...

IMTYPE=0 - then if a go into my browser for http://www.ziarulancheta.ro/components/com_chronocomments/chrono_verification.php?imtype=0&anticache=61835 I SEE NOTHING
IMTYPE=1 - but if i do http://www.ziarulancheta.ro/components/com_chronocomments/chrono_verification.php?imtype=1&anticache=61835 it shows me captcha image.

i came up to the conclusion that it could not be a problem with apache/php config/libraries issue since:

1. i have date/timezone support (seems odd but last time i did a proper config here and captcha image showed up)
date.default_latitude 31.7667 31.7667
date.default_longitude 35.2333 35.2333
date.sunrise_zenith 90.583333 90.583333
date.sunset_zenith 90.583333 90.583333
date.timezone Europe/Bucharest Europe/Bucharest

2. gd support is out there
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.4.4
T1Lib Support enabled
GIF Read Support enabled
GIF Create Support enabled
JPEG Support enabled
libJPEG Version 8
PNG Support enabled
libPNG Version 1.4.5
WBMP Support enabled
XBM Support enabled

As for folder/file permissions.. i have tried all combinations after upgrade
1. folder are 755
drwxr-xr-x 4 ziarulancheta ziarulancheta 512 Mar 29 19:44 com_chronocomments
2. files inside
sonya# cd com_chronocomments/
sonya# ls -la
total 150
drwxr-xr-x 4 ziarulancheta ziarulancheta 512 Mar 29 19:44 .
drwxr-xr-x 19 ziarulancheta ziarulancheta 512 Mar 30 01:34 ..
-rwxr-xr-x 1 ziarulancheta ziarulancheta 199 Mar 13 21:46 background.png
-rwxr-xr-x 1 ziarulancheta ziarulancheta 49 Mar 13 21:46 blank.gif
-rwxr-xr-x 1 ziarulancheta ziarulancheta 4455 Apr 2 07:46 chrono_verification.php
-rwxr-xr-x 1 ziarulancheta ziarulancheta 0 Mar 13 21:46 chronocomments.html.php
-rwxr-xr-x 1 ziarulancheta ziarulancheta 33826 Mar 13 21:46 chronocomments.php
-rwxrwxrwx 1 ziarulancheta ziarulancheta 25748 Mar 13 21:46 default.ttf
-rwxr-xr-x 1 ziarulancheta ziarulancheta 8447 Mar 13 21:46 editor.js
-rwxr-xr-x 1 ziarulancheta ziarulancheta 1804 Mar 13 21:46 iepngfix.htc
drwxr-xr-x 2 ziarulancheta ziarulancheta 1024 Mar 13 20:50 images
-rwxr-xr-x 1 ziarulancheta ziarulancheta 8787 Mar 13 21:46 loaderb.gif
-rwxr-xr-x 1 ziarulancheta ziarulancheta 8787 Mar 13 21:46 loaderw.gif
-rwxr-xr-x 1 ziarulancheta ziarulancheta 951 Mar 13 21:46 msg.css
-rwxr-xr-x 1 ziarulancheta ziarulancheta 10315 Mar 13 21:46 msg.js
-rwxr-xr-x 1 ziarulancheta ziarulancheta 18228 Mar 13 21:46 scripts.js
-rwxr-xr-x 1 ziarulancheta ziarulancheta 4078 Mar 13 21:46 style-ie6.css
-rwxr-xr-x 1 ziarulancheta ziarulancheta 3924 Mar 13 21:46 style.css
drwxr-xr-x 2 ziarulancheta ziarulancheta 512 Mar 13 20:50 templates

it did not work out for 750/644 chrono_verification.php

3. i copied chrono_verification.php into webroot, i did like in FAQ30, called it from within webroot or component folder but chrono_verification.php (with text/html type) does not show but a blank page.

i am running out of options. does anyone here could be kind to show me what it is wrong? could be left out some module/package that should be needed upgrade too ?

thank you very much for your time

p.s. forgot to mention that
a. i use chronocomments 1.0 and joomla 1.5
b. in every top of the page:

<script type="text/javascript">var CommentPublished = 1;
var CommentVerified = 1;
var path = 'http://ziarulancheta.ro/';
var imtype = '0';
var captcha = 1;
var hideemail = 1;
var hideurl = 1;
....

as you can see IMTYPE is always 0 althought if i browse with IMTYPE=1 i can see the image.

c. on log file from server i only see:
[Sun Apr 3 01:36:22 2011] [error] PHP Notice: Undefined offset: 0 in /usr/local/www/data-dist/ziarulancheta.ro/plugins/content/mdrimage.php on line 287

but i am not sure if it have any connection with my problem.
Rani 03 Apr, 2011
SOLVED - in a way

i have got a way to overcome my problem transforming IMTYPE=0 from .png to .gif

1. copy background.png (components/com_chronocomment/background.png) to my PC
2. open it with Adobe Fireworks (or any anvanced graphic program) and save it as .gif with alpha transparency.
3. copy background.gif to /webroot_of_site/components/com_chronocomment/background.png

4. edit chrono_verification (whitch is curently 0755) and modify last part of IMTYPE:

}else{
$image = imagecreatefromgif("background.gif");
$greylight = imagecolorallocate($image, 199, 199, 199);
$black = imagecolorallocate($image, 0, 0, 0);
imagestring ($image, 5, 8, 14, $rand2, $greylight);
imagestring ($image, 5, 5, 11, $rand, $black);
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header('Content-type: image/gif');
imagepng($image);
imagedestroy($image);
}

?>

However still a mistery to me that IMTYPE=0 does not work as .png as it did before upgrade to php 5.3.6
GreyHead 04 Apr, 2011
Hi Rani,

Not sure what is happening here. It could be that your ISP has a security module in place that is preventing the png file type for the imageverification file.

Bob
Rani 05 Apr, 2011
Hi, Bob; thanks a lot for your time to answer.

i own my servers as dedicated high speed connections without any limitations and what you have suggested does not apply here. i am running two modules for apache in order to make my clients webpages more reliable: mod_evasive and mod_tsunami. altghought i disabled them could not get to work png and, more, they were enabled when have used php 5.3.5 and everything was working fine. what bothers me it is that in website pages IMTYPE (in the top of the pages) is always 0 (i did not yet discovered the script who produced those values) and if i browse the address with IMTYPE=1 my png picture appears! so it seems to me that would not be any case of security modules as .png shows. Like so you could see for yourself:
1. IMTYPE=1
http://www.ziarulancheta.ro/components/com_chronocomments/chrono_verification.php?imtype=1&anticache=61835
2. IMTYPE=0 (modified to .gif as .png does not work)
http://www.ziarulancheta.ro/components/com_chronocomments/chrono_verification.php?imtype=0&anticache=61835

so any suggestions ?

thanks in advance
GreyHead 06 Apr, 2011
Hi Rani,

The imtype=1 or imtype=0 is set by the 'What type of image to show ?' option on the Anti-Spam tab.

Bob
This topic is locked and no more replies can be posted.