advert

Tuesday, 10 July 2012

Squirrelmail Cannot redeclare hex2bin()

Introduction

This article describes how I resolved problem with Squirrelmail after upgrade PHP lang.


System:
FreeBSD 8.2-STABLE amd64
Apache/2.2.22
PHP 5.4.3
SquirrelMail version 1.4.22


Problem:

Squirrel mail just hanged and there were only blank page.

httpd-error.log:
PHP Fatal error:  Cannot redeclare hex2bin() in /usr/local/www/squirrelmail/plugins/mail_fetch/functions.php on line 104


Resolve the problem:
I found that there is "simple" problem. We need just rename all occurrences of hex2bin with "convertHex2bin"

Prerequisites:
Rename all occurrences of hex2bin with "convertHex2bin"

Step 1

Find "hex2bin"

/usr/local/www/squirrelmail
FILE /usr/local/www/squirrelmail/plugins/mail_fetch/functions.php
LINE 94 function hex2bin( $data ) {
FILE /usr/local/www/squirrelmail/plugins/mail_fetch/functions.php
LINE 138     $txt = mf_keyED( hex2bin( $txt ) );
FILE /usr/local/www/squirrelmail/plugins/mail_fetch/functions.php
LINE 94 function hex2bin( $data ) {
FILE /usr/local/www/squirrelmail/plugins/mail_fetch/functions.php
LINE 138     $txt = mf_keyED( hex2bin( $txt ) );
FILE /usr/local/www/squirrelmail/plugins/mail_fetch/functions.php
LINE 94 function hex2bin( $data ) {
FILE /usr/local/www/squirrelmail/plugins/mail_fetch/functions.php
LINE 138     $txt = mf_keyED( hex2bin( $txt ) );

Step 2
Rename all with sed

sed -i '' "s/hex2bin/convertHex2bin/g" /usr/local/www/squirrelmail/plugins/mail_fetch/functions.php


References:
http://www.morpheushosting.sk/squirrelmail-cannot-redeclare-hex2bin/

4 komentářů:

Anonymous said...

REALLY Thanks, It worked..

Broozer said...

Thank you, did the same and it works now (used Vim though : %s/hex2bin/convertHex2bin/g ...).

Anonymous said...

Hi, i had issue:
ERROR: Connection dropped by IMAP server.
Please help me! Thanks.

jadawin said...

I can help when you leave contact in comment.
That comment I will not publish.

I had some problems with installation this month. It was related to /var/ directory where are missing folders and also need "chmod www:www /var/missing-folder/"

Hope this help

Post a comment