php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58766 memcached nginx binary data problem
Submitted: 2009-07-17 06:24 UTC Modified: 2012-03-07 17:17 UTC
From: wwDevil at gmail dot com Assigned: andrei (profile)
Status: Closed Package: memcached (PECL)
PHP Version: 5.2.6 OS: ubuntu 9.0.4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: wwDevil at gmail dot com
New email:
PHP Version: OS:

 

 [2009-07-17 06:24 UTC] wwDevil at gmail dot com
Description:
------------
Binary data saved in cache not reading from cache by nginx


Reproduce code:
---------------
$memDB = new Memcached();
$memDB->addServer('localhost',11211,50);
$fp = fopen('png.png','r');
$data = fread($fp, filesize('png.png'));
$memDB->set('/test',$data);

nginx conf
location / {
    #all non static request in index.php. wdevil
    add_header    Content-Type  "image/png;";
    set             $memcached_key   "/test";
    memcached_pass  localhost:11211;
}

nginx response to browser binary data. no png binary.
If i replace Memcached --> Memcache class. All ok.

Expected result:
----------------
png img in browser


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-17 06:26 UTC] wwDevil at gmail dot com
Version 	1.0.0
libmemcached version 	0.31
Session support 	yes
igbinary support 	no
 [2009-07-17 12:44 UTC] andrei@php.net
Try turning compression off.

$m->setOption(Memcached::OPT_COMPRESSION, false);
 [2012-03-07 17:17 UTC] andrei@php.net
Closing because of age. Please try version 2.0.1 and reopen if this still occurs. 
Might have been due to compression being on.
 [2012-03-07 17:17 UTC] andrei@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: andrei
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC