I am loading images from a single PostgreSQL database shared currently by my production and development instances. This is already a little inaccurate – the production server isn’t live yet, which is why it’s okay they share a DB. The software itself is written in PHP5.3.
The issue is this: my image storage routine works on both servers. An image stored using either branch can be displayed properly in the production branch. However, the images are completely nonviewable on the production side.
Invoking the image display script directly yields the discovery that the data returned by each is markedly different. The production server provides (excerpt):
‰PNG IHDR99zÒ IDAThL&³Ùaaaýýýþþþþþþþþþýýýýýý" ø÷øëðïêññçîîàëêßêêìööPPP;'(8&'"þþúúüýýýþþÿþõÛëìÇÙÙÈÞÝòúúLLL P45B-,üý÷÷ýýÿÿÿÿþþþÿýýþþÿÿþþÿ íÿºÒÒµÕÔòúúKKKÿÿÿF**]=?ýýõõÿÿÿ
while the development server delivers (excerpt):
x89504e470d0a1a0a0000000d4948445200000039000000390802000000037a14d200002000494441546805014c26b3d9016161610000000000000000000000000000000000000000000000000000000000000000000000000000000
for the same image. Curiously, the development server’s response echoes what the actual database appears to be storing.
The relevant code appears to be identical between instances. Investigating php.ini yields only minor differences relating to error reporting. I’m all but certain this is a server communication issue but I am at a loss as to what exactly is causing it.
You got a configuration mismatch :
http://www.postgresql.org/docs/9.0/static/runtime-config-client.html#GUC-BYTEA-OUTPUT