You are not logged in.

#1 2009-07-31 03:12:16

rklingsten
Member
Registered: 2009-07-31
Posts: 29

Can't get GD working with PHP

Hi folks -

I've installed 'gd' which installed its dependencies of libpng, libjpeg and freetype2 with no problems.  I've also enabled the module in the php.ini.  However, I can't get gd to work (trying to get a photo gallery plugin working in Wordpress) ... according to the phpinfo, PHP was built with the gd option.  Also I enabled error logging in the php.ini and I don't see anything in any logs about errors with the gd module.

Any suggestions?

thanks for any help!

Rob K

Offline

#2 2009-08-03 05:56:25

paddan
Member
Registered: 2009-08-03
Posts: 6

Re: Can't get GD working with PHP

Weird. Having the exact same issue. I was just going here to make an exact thread like this haha.

Latest php and gd. Doesnt give me any error what so ever. Its even loaded when doing php -m

Offline

#3 2009-08-03 13:07:03

rklingsten
Member
Registered: 2009-07-31
Posts: 29

Re: Can't get GD working with PHP

I figured mine out... I had to re-install PHP. The file /usr/lib/php/20060613/gd.so was linked to /usr/lib/libjpeg.62.so which didn't exist, instead there is libjpeg.7.so.  Works now. But mine wasn't even loading so, probably not the same issue? Try doing ldd /usr/lib/php/20060613/gd.so and make sure it's finding all its libraries.

good luck!

Offline

#4 2009-08-03 18:15:17

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: Can't get GD working with PHP

rklingsten wrote:

I figured mine out... I had to re-install PHP. The file /usr/lib/php/20060613/gd.so was linked to /usr/lib/libjpeg.62.so which didn't exist, instead there is libjpeg.7.so.

Doing partial upgrades, are we? tongue

Offline

#5 2009-08-03 18:33:15

rklingsten
Member
Registered: 2009-07-31
Posts: 29

Re: Can't get GD working with PHP

foutrelis wrote:

Doing partial upgrades, are we? tongue

Not that I'm aware of, at least not on purpose ... although I did not do a -Syu first before simply installing 'gd' ...

Offline

#6 2009-08-03 18:46:01

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: Can't get GD working with PHP

Oh, if you installed gd with '-Sy' that would explain how you got the new libjpeg (latest gd depends on it), while keeping php at its current version. I've seen '-Sy' being a suggested way to install a package on the wiki before, but it appears that it can cause issues like yours.

Good thing you were able to fix it by yourself. I doubt anyone could have guessed what happened easily. smile

@paddan: Open a new thread if you're still having trouble, giving as much details as possible.

Last edited by foutrelis (2009-08-03 18:47:59)

Offline

#7 2009-08-03 21:13:29

paddan
Member
Registered: 2009-08-03
Posts: 6

Re: Can't get GD working with PHP

"ldd /usr/lib/php/20060613/gd.so
    linux-gate.so.1 =>  (0xb8064000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7f81000)
    libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb7f5b000)
    libz.so.1 => /usr/lib/libz.so.1 (0xb7f47000)
    libjpeg.so.7 => /usr/lib/libjpeg.so.7 (0xb7f13000)
    libc.so.6 => /lib/libc.so.6 (0xb7dca000)
    libm.so.6 => /lib/libm.so.6 (0xb7da4000)
    /lib/ld-linux.so.2 (0xb8065000)
"

the libjpeg.so.7 doesnt exist. i only have /usr/lib/libjpeg.so.62 . could this be the problem?
how would it be possible to fix it?

seems to be related tho.

rklingsten: how did you re-install php. so i can try the same. im a debian kind of guy so i end up doing stuff wrong smile

Last edited by paddan (2009-08-03 21:30:23)

Offline

#8 2009-08-03 22:07:02

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Re: Can't get GD working with PHP

paddan wrote:

"ldd /usr/lib/php/20060613/gd.so
    linux-gate.so.1 =>  (0xb8064000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7f81000)
    libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb7f5b000)
    libz.so.1 => /usr/lib/libz.so.1 (0xb7f47000)
    libjpeg.so.7 => /usr/lib/libjpeg.so.7 (0xb7f13000)
    libc.so.6 => /lib/libc.so.6 (0xb7dca000)
    libm.so.6 => /lib/libm.so.6 (0xb7da4000)
    /lib/ld-linux.so.2 (0xb8065000)
"

the libjpeg.so.7 doesnt exist. i only have /usr/lib/libjpeg.so.62 . could this be the problem?
how would it be possible to fix it?

seems to be related tho.

rklingsten: how did you re-install php. so i can try the same. im a debian kind of guy so i end up doing stuff wrong smile

Try updating libjpeg.

Offline

#9 2009-08-03 23:02:19

paddan
Member
Registered: 2009-08-03
Posts: 6

Re: Can't get GD working with PHP

did pacman -S libjpeg . even before this. still the same thing.

how do your ldd /usr/lib/php/20060613/gd.so look like.

gd doesnt show up in phpinfo() so it doesnt load. this is so annoying.
what more info would you need?

Offline

#10 2009-08-04 13:01:29

rklingsten
Member
Registered: 2009-07-31
Posts: 29

Re: Can't get GD working with PHP

paddan wrote:

"ldd /usr/lib/php/20060613/gd.so
    linux-gate.so.1 =>  (0xb8064000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb7f81000)
    libpng12.so.0 => /usr/lib/libpng12.so.0 (0xb7f5b000)
    libz.so.1 => /usr/lib/libz.so.1 (0xb7f47000)
    libjpeg.so.7 => /usr/lib/libjpeg.so.7 (0xb7f13000)
    libc.so.6 => /lib/libc.so.6 (0xb7dca000)
    libm.so.6 => /lib/libm.so.6 (0xb7da4000)
    /lib/ld-linux.so.2 (0xb8065000)
"

the libjpeg.so.7 doesnt exist. i only have /usr/lib/libjpeg.so.62 . could this be the problem?
how would it be possible to fix it?

seems to be related tho.

rklingsten: how did you re-install php. so i can try the same. im a debian kind of guy so i end up doing stuff wrong smile

Well, yours looks different than mine did ... you said the file libjpeg.so.7 doesn't exist, but it seems that ldd is finding it somehow.  Mine originally said "libjpeg.so.7 => not found"

After messing with it for awhile, I simply did a pacman -S php and that fixed it which gave me a new PHP gd.so module linked to the updated libjpeg library.

Offline

#11 2009-08-04 21:22:46

paddan
Member
Registered: 2009-08-03
Posts: 6

Re: Can't get GD working with PHP

ive done that too. did it to libjpeg,libpng,freetype2 and gd. 

Still nothing. Im getting tired of this. and it takes up alot of important time heh.

any idea?

Offline

#12 2009-08-05 12:12:55

paddan
Member
Registered: 2009-08-03
Posts: 6

Re: Can't get GD working with PHP

From what i remember when dealing with Arch, it sometimes needs restarts when messing with stuff.
Its not my box so i dont dare rebooting it.

But i bet this will fix it.

Offline

#13 2009-08-05 12:35:08

paddan
Member
Registered: 2009-08-03
Posts: 6

Re: Can't get GD working with PHP

Ok finally solved it.

Had old php-cgi processes running so php didnt get a proper restart when restarting lighttpd.

Thanks for the help.

Offline

Board footer

Powered by FluxBB