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/