homepage Welcome to WebmasterWorld Guest from 54.205.182.45
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
gd installed but still give imagecreate() error
php imagecreate fatal error
Seregwethrin




msg:3413737
 6:51 pm on Aug 4, 2007 (gmt 0)

Hello friends;

I've build my php 5.2.3 with gd2 (also i installed gd2 libraries)

My php configure command is ( from phpinfo() )
'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql' '--with-curl' '--with-curldir=/usr/bin' '--with-gd2' '--with-mcrypt' '--with-mhash' '--with-pear' '--with-zlib' '--with-zip' '--enable-ftp' '--enable-magic-quotes' '--enable-mbstring' '--with-freetype'

Anybody knows why still gives Call to undefined function imagecreate() fatal error :/

Thanks.

 

2oddSox




msg:3413865
 11:04 pm on Aug 4, 2007 (gmt 0)

Ok, first a disclaimer. I can hardly spell 'PHP', let alone advise anyone how to do anything with it. But...

I had exactly the same error message dealing with a CAPTCHA just yesterday and, in the end, despite phpinfo saying all was well with gd2 I had to edit my php.ini file by uncommenting the extension=php_gd2.dll line, and ensuring that the path to the loadable extensions was correct. A quick reboot after that and all worked just fine.

Good luck.

Seregwethrin




msg:3414108
 9:58 am on Aug 5, 2007 (gmt 0)

But I'm using Linux, now windows :(

I've rebuild the php with gd2 and freetype again with this ./configure parameters.

'./configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-mysql' '--with-curl' '--with-gd' '--with-mcrypt' '--with-mhash' '--with-gettext' '--with-zlib' '--with-openssl' '--with-freetype-dir' '--with-bz2' '--without-iconv' '--with-mime-magic' '--enable-magic-quotes' '--enable-mbstring' '--enable-zip' '--enable-sockets' '--enable-ftp' '--enable-zend-multibyte' '--enable-gd-native-ttf'

And the gd_info() gives (this was the problem at old build, i've build --with-gd2, but it must --with-gd :))

array(12) {
["GD Version"]=>
string(27) "bundled (2.0.34 compatible)"
["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(false)
["PNG Support"]=>
bool(true)
["WBMP Support"]=>
bool(true)
["XPM Support"]=>
bool(false)
["XBM Support"]=>
bool(true)
["JIS-mapped Japanese Font Support"]=>
bool(false)
}

But there's still error with "["JPG Support"]=> bool(false)". Now i can use imagecreate becase gd built, but i cant use ImageCreateFromJpeg becase JPG Support not enabled.

I've searched on the web, and i found that libjpeg library must be installed and php must built with "--with-jpeg-dir[=jpg_lib_dir]" configure parameter. I installed libjpeg library, but php can't find libjpeg.so or libjpeg.a

And i found the problem at last :)

I build libjpeg with ./configure --enable-shared --enable-static

Now php can see libjpeg files, and everything is ok.

Maybe this solution will be help someone another day.

Thanks for reading.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved