Re: Problem with mbstring.internal_encoding, mcrypt and php-fpm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hristo,

Try changing the php.ini config:

mbstring.func_overload 0

See if that helps your issue, more on what it does:
http://php.net/manual/en/mbstring.overload.php

Aziz


On Mon, Sep 23, 2013 at 8:23 AM, Condor <condor@xxxxxxxxxx> wrote:

>
> Hello,
>
> from two days I have strange problem with this param
> mbstring.internal_encoding on nginx and php-fpm.
> I use php version 5.4.20 and when I setting mbstring.internal_encoding I
> have a problem with mcrypt.
>
> NOTICE: PHP message: PHP Warning:  mcrypt_generic_init(): Iv size
> incorrect; supplied length: 12, needed: 8 in file.php
>
> I setup php.ini file:
>
> zend.multibyte = On
> default_mimetype = "text/html"
> default_charset = "UTF-8"
> mbstring.internal_encoding = UTF-8
>
>
>
> and here is function:
>
>  85         private function decrypt($blob)
>  86         {
>  87                 $deckey = $_SESSION['key'];
>  88                 $realkey = sha1($deckey, true);
>  89                 $rawblob = hex2bin($blob); /* binary blob */
>  90                 $td = mcrypt_module_open($this->**CIPHER, "",
> MCRYPT_MODE_CFB, "");
>  91                 $iv = mb_substr($rawblob, 0,
> mcrypt_enc_get_iv_size($td)); /* IV */
>  92                 if (mb_strlen($iv) < mcrypt_enc_get_iv_size($td))
> return FALSE;
>  93                 $ct = mb_substr($rawblob,
> mcrypt_enc_get_iv_size($td)); /* CipherText */
>  94    --->         mcrypt_generic_init($td, $realkey, $iv);
>  95                 $unblob = mdecrypt_generic($td, $ct);
>  96                 mcrypt_generic_deinit($td);
>  97                 $pt = mb_substr($unblob, 20);
>  98                 $check = mb_substr($unblob, 0, 20);
>  99                 if ($check != sha1($pt, true))
> 100                 {
> 101                         return FALSE;
> 102                 } else {
> 103                         return $pt;
> 104                 }
> 105         }
>
>
> The same code with the same config options is worked fine with apache
> httpd.
>
> Any one can give me a little help ?
> Thanks
>
> Regards,
> Hristo S.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux