I have installed Drupal 7.0-alpha6 on Ubuntu. But when I went to Reports/Status report, I found a pink-colored area catagorized as "GD library rotate and desaturate effects 2.0 or higher" containing the following error message:

"The GD Library for PHP is enabled, but was compiled without support for functions used by the rotate and desaturate effects. It was probably compiled using the official GD libraries from http://www.libgd.org instead of the GD library bundled with PHP. You should recompile PHP --with-gd using the bundled GD library. See the PHP manual"

I had done "sudo apt-get install php-gd" before I installed Drupal 7. Was there anything wrong with this?

Comments

dman’s picture

Nothing wrong with apt-get to do this. It's the normal way.
But as the message says, it's not quite the way you need to do things iff you want to use "desaturate" on your images. Or rotate them against transparent backgrounds (or clockwise vs anticlockwise or some minor inconsistency like that).
In the main - this warning is no big deal to most users. It's just a slightly out-of-sync library version thing.

If you really DO need to use the compiled image desaturate functions, then you do need to recompile PHP by hand - As the message says. This is NOT for the faint-hearted, and will probably eat up half a day of your life you won't get back if it's the first time you've ever tried such a thing.
GD will require libPNG, LibPNG will require LibTruetype or something, LibTruetype will require a LibXML upgrade. LibXML will require something else. It can be brain-eating if you've not set up your machine as a 'build' machine in the first case, and you'll have to start reading the build messages to pick out what's really needing attention. Can be done, but it's more tedious than it looks.

First advice: Run phpinfo and carefully copy and save the current compile arguments you will see at the top. You'll need them later.
Then check out the Ubuntu forums for a quick 26-step plan on what to do next.

But really, avoid it and stick with apt-get if you can live with it.

.dan.

Dien’s picture

Thank you so much for your expert advises. It sounds very challenging to fix it. So far I will take your advise as avoid it until I really need it because I have to move quickly to build up the web site for a big company in Taiwan. I will keep your instructions in my record for I might need it in the future.

mdlueck’s picture

You mentioned Ubuntu so, dig into my notes of setting up Drupal on Ubuntu and...

Add GD to PHP
# sudo apt-get install php5-gd

Thus no need to recompile PHP, just add the correct package. Hope that helps!

Dien’s picture

Appreciate your enthusiastic help.

I run your note command on Ubuntu:
# sudo apt-get install php5-gd

I got:
-------------------------------------
24 packages can be updated.
36 updates are security updates.
建相ä¾ä¿‚
正在讀å–狀態資料... 完æˆ2010 ‡ç´šã€‚.144.103.122
a274251@drupal6:~$ ‰è£‰ 17 個未被åll php5-gd
季在é‡å»ºç›¸ä¾ä¿‚... 0%51:
正在é‡å»ºç›¸ä¾ä¿‚... 0% Œæˆ
正在é‡
-------------------------------------
I run it several times again and got some similar garbled messages which looked different from the above listing.
Then I use my IE to accesss my web site and found the GD error message unchanged.

It is enough to make me happy to have somebody help me.

mdlueck’s picture

aaahh, hello.... That message says that you have security updates you need to apply to this server!

Aptitude is the name of the package manager. You may read about it here:
https://help.ubuntu.com/8.04/serverguide/C/aptitude.html
(Link to the Ubuntu 8.04 docs version.)

Run that, (via sudo aka as root) "u" to update the package list from the repositories, "U" to mark all packages that an update is needed for, "g" to be shown a list of what is going to be updated, "g" once more to do said updates. Once done, "q" to quit / exit.

Then my previous command should work and you should not be prompted about available updates to existing packages.

(And perhaps the server needs to be rebooted... not sure what packages need to be updated. Definitely reboot if the kernel got updated.)

Dien’s picture

In Ubunbtu, I executed:
$ sudo aptitude
then typed: "u", "U"(got no response),"g" and "g" again, "q". then
$sudo update
$sudo apt-get install php5-gd (got garbled message)
$sudo reboot
then went to my IE, invoked the web site again, and still found the GD error message unchanged.

It looks like a guru teacher encounters a dull student!

mdlueck’s picture

When you pressed "U" the all you would have seen is in the top/right numbers would show up / appear indicating how many packages need to be downloaded / size / space requirements.

"g" and again "g" should have downloaded said packages. Is that what you saw? If so, then good.

I have no idea why installing php5-gd shows gabled messages. Perhaps do you have your Ubuntu set to some other language than English? Perhaps the characters are not coming through properly with what ever remote (ssh) product you are using on your local computer?

I would suggest moving this conversation to http://ubuntuforums.org/ as it is more to do with Ubuntu rather than Drupal.

Dien’s picture

Accordingly, I pressed "U" and then saw "DL size 242KB" show up this time. I did press "g" and again "g" last time, so it should have downloaded the packages. You're right, my PC is in Traditional Chinese version of Windows XP and connected to the Ubuntu server using putty through SSH. Admire your guru insight.
Yes, I might move this conversation to http://ubuntuforums.org/ , however feel kind of embarrassing to show my dull knowledge.
Thank you for your patience and kindness.

mdlueck’s picture

All right, everything sounds like what I expected.

One thought just came to me... Like I said I researched that for use on an Ubuntu 8.04 web server. Possibly the package name has been changed in 10.04.

But still, I have no idea why the computer would present "gibberish" characters when you run the command trying to add the one package.

Dien’s picture

Thank you so much!

Dien’s picture

Version: 7.0-alpha6 » 7.0-alpha7

I have reinsatalled Ubuntu 10.04 to overwrite the original Ubuntu 9.04 then I completed everything for installing Drupal 7.0-Alpha 7 and I found the "GD Library" error message disappeared.

heine’s picture

Status: Active » Fixed

Glad you got it fixed. This support request would be better at home on an Ubuntu support forum though.

Dien’s picture

I am green in both Ubunbtu and Drupal. It is enough to make me proud to get involved in you gurus' discussion.

mdlueck’s picture

@Dein #11: Woo hoo! Thanks for confirming the problem resolution. :-)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

rsvelko’s picture

in conclusion : (for you who found this via google )

updating your php from 5.2 to 5.3 will fix it.

if its a drupal 7 site , the php to 5.3 update might cause your site to not start properly at first.
Dont panic - look into your apache error log and google the error - it is easily repairable.

There was a php error about some mysql / database.inc class being re-declared twice...

I had to add sth like

apc.include_once_override = 0

to my php.ini or apc.ini locally in the www folder ir in /etc/php5 globally .