mysql - decode is not working correctly after upgrade the php to 5.5 -
i use codeigniter encryption lib keep encoded company name. working php 5.3. upgrade os ubuntu 14.04. php version 5.5. old saved company names not working. same code , same db working in php 5.4 machine.
old encrypted company name
$name = 'atq1tmbtvclv8iedfcx/+rxhxj1cwxxypybpi/q0cxqe2pimqa/w3ze88199dwfp1l6cfa1msuwedwd1z0gmmw==' $company_name = $this->encrypt->decode($name); echo $company_name; //result - ¾Ôf–s÷nŽ^¨h‡éêÁoðq‹û'É>Åì¦Ô—
but works newly created company. issue?
it might new php installation doesn't have mcrypt library installed (or new 1 has it, , old didn't)
the encoding library checks if extension installed, , if not proceeds custom method:
if ($this->_mcrypt_exists === true) { $enc = $this->mcrypt_encode($string, $key); } else { $enc = $this->_xor_encode($string, $key); }
the reverse same: if have mcrypt, uses mycrypt_decode($data, $key), else _xor_decode($string, $key). try installing mcrypt
$ sudo apt-get install php5-mcrypt
and should work. or re-encode other system, suggest former.
n.b. this guess, since didn't tell (so far) if have extension (or if didn't have before) nor said ci version, browsed 1 had on server. i'm sure reason this)
Comments
Post a Comment