Forum Moderators: coopster

Message Too Old, No Replies

GD - I can't create images on my linux box.

It appears to be installed properly and works fine on windows...

         

theboywhogotlost

12:54 am on Jun 23, 2006 (gmt 0)

10+ Year Member



When I try to create the simplist img the browser download a empty .php page...

phpinfo(); produces...

Configure Command:

'./configure' '--with-config-file-path=/etc' '--with-mysql=/usr/local/mysql' '-enable-ftp' '--enable-bcmath' '--disable-debug' '--with-gd=/usr/local/gd2' '--with-gd-native-ttf' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-zlib=/usr' '--with-imap=../imap-2001a' '--with-apxs=/usr/local/apache/sbin/apxs' '--with-freetype-dir=/usr/local/freetype' '--with-ttf' '--with-openssl-dir=/usr/local/openssl' '--with-curl' '--with-pear' '--enable-mbstring' '--with-calendar=shared' '--enable-memory-limit' '--enable-magic-quotes' '--enable-wddx'
'--with-mhash' '--with-kerberos' '--with-dom=/usr/local/xml2'

GD:
GD Support enabled
GD Version 2.0 or higher
FreeType Support enabled
FreeType Linkage with freetype
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled

theboywhogotlost

2:17 am on Jun 23, 2006 (gmt 0)

10+ Year Member



here is my code. imager.png does exist.

<snipped urls>

image uploaded in binary mode, php file in ascii

<?php

header("Content-type: image/png");
$string = 'testdddddddddddddddddd';
$im = imagecreatefrompng("imager.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);

?>

[edited by: coopster at 1:45 pm (utc) on June 23, 2006]
[edit reason] removed urls per TOS [webmasterworld.com] [/edit]

coopster

1:59 pm on Jun 23, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, theboywhogotlost.

The code looks fine and I tested it on both a Windows server and on a *nix server without issue. Have you tried turning up your error_reporting() [php.net] to see if you are receiving any errors or have you checked your server logs for any errors?

theboywhogotlost

2:38 pm on Jun 23, 2006 (gmt 0)

10+ Year Member



yes, I set

error_reporting(E_ALL);

at the top of the script and I still get a completly blank page when calling it.

my error logs also are empty...

Do you see anything wrong with my GD setup...

coopster

2:46 pm on Jun 23, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Looks fine to me. Maybe it is a browser issue? Did you try clearing the browser cache?

theboywhogotlost

3:00 pm on Jun 23, 2006 (gmt 0)

10+ Year Member



It's not a browser issue, I've tried it at work at home and a friend tried it...

It's got to be somthing with my php installation(I would think).

coopster

3:06 pm on Jun 23, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Perhaps it is your image installation [php.net] then.


To enable GD-support configure PHP
--with-gd[=DIR]
, where DIR is the GD base install directory. To use the recommended bundled version of the GD library (which was first bundled in PHP 4.3.0), use the configure option
--with-gd
. GD library requires libpng and libjpeg to compile.

Maybe try recompiling, taking careful note of installation instructions? I don't know where else to advise right now except this route as the code looks correct.

eelixduppy

3:08 pm on Jun 23, 2006 (gmt 0)



>>> Perhaps it is your image installation then.

Try this to see what you get:


var_dump(gd_info());

theboywhogotlost

3:10 pm on Jun 23, 2006 (gmt 0)

10+ Year Member



I'm using php version: PHP 4.3.10

var_dump(gd_info());

reasulted in:

array(11) {
["GD Version"]=>
string(13) "2.0 or higher"
["FreeType Support"]=>
bool(true)
["FreeType Linkage"]=>
string(13) "with freetype"
["T1Lib Support"]=>
bool(false)
["GIF Read Support"]=>
bool(true)
["GIF Create Support"]=>
bool(true)
["JPG Support"]=>
bool(true)
["PNG Support"]=>
bool(true)
["WBMP Support"]=>
bool(true)
["XBM Support"]=>
bool(false)
["JIS-mapped Japanese Font Support"]=>
bool(false)
}

theboywhogotlost

4:00 pm on Jun 23, 2006 (gmt 0)

10+ Year Member



I think this is why...

Configuration summary for gd 2.0.33:

Support for PNG library: yes
Support for JPEG library: yes
Support for Freetype 2.x library: no
Support for Fontconfig library: no
Support for Xpm library: yes
Support for pthreads: yes

whoisgregg

5:40 pm on Jun 23, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check permissions on imager.png.

theboywhogotlost

6:25 pm on Jun 23, 2006 (gmt 0)

10+ Year Member



Permissions are fine...