Quantcast

dynamic png not working

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

dynamic png not working

Chris Cortese
I just noticed on one of my sites that my php script that calls
header("Content-type: image/png") and imagepng(), etc., is not creating
a png image.  This was working before but I've not only switched to
nginx from Apache, I've also switched to a new server, new build of PHP,
etc...

Do I need to do something special with the nginx config to make this happen?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dynamic png not working

Michael Shadle
no, that'd be a php thing most likely.

try firefox it's a bit more forgiving with incorrect headers. it could
be the build of php doesn't support it, or you have extra characters
in the file being outputted before the png data, so the browser is
getting trash... that's usually the case i see.


On Sun, Mar 15, 2009 at 8:33 AM, Chris Cortese
<[hidden email]> wrote:
> I just noticed on one of my sites that my php script that calls
> header("Content-type: image/png") and imagepng(), etc., is not creating a
> png image.  This was working before but I've not only switched to nginx from
> Apache, I've also switched to a new server, new build of PHP, etc...
>
> Do I need to do something special with the nginx config to make this happen?
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dynamic png not working

Cliff Wells
In reply to this post by Chris Cortese
On Sun, 2009-03-15 at 08:33 -0700, Chris Cortese wrote:
> I just noticed on one of my sites that my php script that calls
> header("Content-type: image/png") and imagepng(), etc., is not creating
> a png image.  This was working before but I've not only switched to
> nginx from Apache, I've also switched to a new server, new build of PHP,
> etc...
>
> Do I need to do something special with the nginx config to make this happen?


Your problem is almost certainly related to directory permissions or a
missing PHP library.

Cliff


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dynamic png not working

Glen Lumanau
In reply to this post by Chris Cortese
Build your php --with-gd and --with-png-dir

Make sure you have install png library

------Original Message------
From: Cliff Wells
Sender: [hidden email]
To: [hidden email]
ReplyTo: [hidden email]
Subject: Re: dynamic png not working
Sent: Mar 15, 2009 10:46 PM

On Sun, 2009-03-15 at 08:33 -0700, Chris Cortese wrote:
> I just noticed on one of my sites that my php script that calls
> header("Content-type: image/png") and imagepng(), etc., is not creating
> a png image.  This was working before but I've not only switched to
> nginx from Apache, I've also switched to a new server, new build of PHP,
> etc...
>
> Do I need to do something special with the nginx config to make this happen?


Your problem is almost certainly related to directory permissions or a
missing PHP library.

Cliff




Best Regards,

Glen Lumanau
-
Sent from my BlackBerry®
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dynamic png not working

Chris Cortese
thx for the ideas and you're right, not an nginx issue.  Not sure what
was exactly the final step but I did need to clean up some of php's
config options.

Glen Lumanau wrote:

> Build your php --with-gd and --with-png-dir
>
> Make sure you have install png library
>
> ------Original Message------
> From: Cliff Wells
> Sender: [hidden email]
> To: [hidden email]
> ReplyTo: [hidden email]
> Subject: Re: dynamic png not working
> Sent: Mar 15, 2009 10:46 PM
>
> On Sun, 2009-03-15 at 08:33 -0700, Chris Cortese wrote:
>  
>> I just noticed on one of my sites that my php script that calls
>> header("Content-type: image/png") and imagepng(), etc., is not creating
>> a png image.  This was working before but I've not only switched to
>> nginx from Apache, I've also switched to a new server, new build of PHP,
>> etc...
>>
>> Do I need to do something special with the nginx config to make this happen?
>>    
>
>
> Your problem is almost certainly related to directory permissions or a
> missing PHP library.
>
> Cliff
>
>
>
>
> Best Regards,
>
> Glen Lumanau
> -
> Sent from my BlackBerry®
>  


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: dynamic png not working

Michael Shadle
with php-fpm of course... :)

./configure \
--enable-fastcgi \
--enable-discard-path \
--enable-force-cgi-redirect \
--enable-fpm \
--with-fpm-pid=/var/run/php-fpm.pid \
--with-fpm-log=/var/log/php-fpm.log \
--with-fpm-conf=/etc/php-fpm.conf \
--enable-cli \
--enable-inline-optimization \
--disable-rpath \
--disable-ipv6 \
--enable-mbstring \
--enable-mbregex \
--enable-sqlite-utf8 \
--with-gettext \
--with-mysql \
--with-mysqli=/usr/bin/mysql_config \
--with-curl \
--with-zlib \
--with-gd \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-freetype-dir \
--enable-gd-native-ttf \
--enable-exif \
--enable-shmop \
--with-xsl=shared \
--with-mssql=shared \
--enable-soap=shared \
--enable-sockets \
--enable-pcntl=shared \
--with-mcrypt \
--with-bz2 \
--with-tidy \
--with-pcre-dir \
--with-openssl \
--with-imap=shared \
--with-imap-ssl \
--with-kerberos \
--with-pear \
--with-gmp


On Sun, Mar 15, 2009 at 9:46 AM, Chris Cortese
<[hidden email]> wrote:

> thx for the ideas and you're right, not an nginx issue.  Not sure what was
> exactly the final step but I did need to clean up some of php's config
> options.
>
> Glen Lumanau wrote:
>>
>> Build your php --with-gd and --with-png-dir
>>
>> Make sure you have install png library
>>
>> ------Original Message------
>> From: Cliff Wells
>> Sender: [hidden email]
>> To: [hidden email]
>> ReplyTo: [hidden email]
>> Subject: Re: dynamic png not working
>> Sent: Mar 15, 2009 10:46 PM
>>
>> On Sun, 2009-03-15 at 08:33 -0700, Chris Cortese wrote:
>>
>>>
>>> I just noticed on one of my sites that my php script that calls
>>> header("Content-type: image/png") and imagepng(), etc., is not creating a
>>> png image.  This was working before but I've not only switched to nginx from
>>> Apache, I've also switched to a new server, new build of PHP, etc...
>>>
>>> Do I need to do something special with the nginx config to make this
>>> happen?
>>>
>>
>>
>> Your problem is almost certainly related to directory permissions or a
>> missing PHP library.
>>
>> Cliff
>>
>>
>>
>>
>> Best Regards,
>>
>> Glen Lumanau
>> -
>> Sent from my BlackBerry®
>>
>
>
>

Loading...