Recompile GD library
The installed version of PHP GD does not support image rotations. It was probably compiled using the official GD libraries from
So if i want to recompile this libraries how to do that? I have ubuntu installed and tried to do this recompiling but had problems, some help please?
22 Replies
Ok maybe i dont need to recompile, just install? I have drupal site that sends me this messages and also i can see evidence of this, image quality is not good when using some crops/scale etc.
Anyway please give me some instructions what to put to have high quality GD library?
apt-get update && apt-get dist-upgrade
You'll get a bunch of lines from the "apt-get update", then after that, the "apt-get dist-upgrade" will show you what can but update. Glance over what's here (if it shows stuff being removed, double check what it wants to remove), then either type 'Y' for 'Yes, do this upgrade' or 'N' for 'No, don't do this upgrade'.
If your running Debian 5.0, a dist-upgrade probably won't help with your GD library. Debian tends to avoid upgrades, and will only provide security updates. You'd be better trying to find a Debian 6.0 version of your stack script, or go to your Linode Manager and re-deploy with Debian 6.0, and install what you need.
"The installed version of PHP GD does not support image filtering(desaturate, blur, negate, etc). It was probably compiled using the official GD libraries from
from Drupal site.
If I redeploy i would loose all my data right? How could i install debian 6 and still keep them? And if so i was thinking to better use CentOS? what do you recommend?
You can use the scp (copy over ssh) command. If you use Linux or Mac, scp is built in. In Windows, you can use a program called WinSCP to have a graphical version of scp.
What you would do is create a tarball of your data in your home directory of your data then scp it to your home computer. On your Linode:
cd ~
tar cjvf backup.tar.bz2 /directory/to/backup /another/directory/to/backup /path/to/file/to/backup.txt
The first command puts you in your home directory.
You can name backup.tar.bz2 whatever you want, except that the '.tar.bz2' should remain the same, and the part before .tar.bz2 should not have any spaces. After backup.tar.bz2, you can specify as many files and directories as you want in the backup.
To get that to your home computer, you can either use WinSCP in Windows, or the following command in Windows/Mac:
cd ~
scp username@mylinode:~/backup.tar.bz2 .
Replace username with the user name you use to log in to your Linode. Replace 'mylinode' with your Linode's IP address OR with your Linode's domain name, e.g. if
The colon and tilde are needed, though if you named your tarball something different from backup.tar.bz2, you'll need to change that part.
The space period ' .' at the end says "copy the file to the directory I'm in right now'.
If you want to double check the tarball, use:
tar xjvf backup.tar.bz2
That'll unpack the tarball into the current directory. You can check to see if it has everything it needs.
After that, log in to your Linode Manager and redeploy.
CentOS uses the same update policy as Debian: Once we release a new version, we only provide it with security updates. So now that CentOS 6 is out, it won't get any new software until CentOS 7 (or until 6.1, depending on their release cycle, I don't know if the new software will be 6.1 or in 7). They feel that new software should go through rigorous testing before it's allowed in, and usually by the time it makes it in, they're already ready to make a new release.
The main problem I have with CentOS is that when you need newer software than they provide, you have to find a third party repo that isn't associated or affiliated with CentOS (at least not as far as I know), e.g. in order to run Drupal on another server that was running CentOS 5.5, I had to add a repo called WebTactic to get a newer version of PHP than CentOS had, and AFAIK the guy who runs that repo isn't associated with CentOS but is just a CentOS user. In Debian, you can use Debian Backports and dotdeb, which will expand the software available to you and will have newer versions of software already available to you. I have yet to have issues with either of these. Even so, it's still good to update to the newer Debian because they won't update every single core package, and with 6.0 out, there won't be as many updates added to 5.0.
To add dotdeb and Deian Backports, edit the file /etc/apt/sources.list (e.g. 'nano /etc/apt/sources.list'), and add the following lines:
# dotdeb
deb http://packages.dotdeb.org oldstable all
deb-src http://packages.dotdeb.org oldstable all
# Backports
deb http://backports.debian.org/debian-backports lenny-backports main
deb http://backports.debian.org/debian-backports lenny-backports-sloppy main
This tells the package manager (software manager) where to go to install stuff from Dotdeb and Backports.
Then:
wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | apt-key add -
apt-get update && apt-get -t lenny-backports dist-upgrade && apt-get dist-upgrade
The first two lines grab the authentication key for dotdeb and adds it to the package manager so it knows it's authentic (AFAIK Backports doesn't need that). Th second line tells apt-get to update it's list of installable software, then tells it to upgrade all software from Backports only (you need to specify '-t lenny-backports' to install/upgrade anything from Debian Backports, Debian 6.0 would call it 'squeeze-backports' instead), then tells it to upgrade anything that Backports doesn't have an upgrade for.
(edited to explain the commands).
My idea was to maybe get a new Linode, put new OS there, transfer all sites there and then just change DNS settings, no downtime and quicker solution, only a bit more expensive.
Anyway i dont know what to use than, centos debian or ubuntu? first i used ubunut then i read debian is better for stability then i read centOs is mostly used on hosting sites.
so… ? please provide your favourite and why?
this is PHP i have PHP Version 5.2.6-1+lenny13
when i try this
linode:/# apt-get install php5-gd
Reading package lists… Done
Building dependency tree
Reading state information… Done
php5-gd is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
so i have php5-gd but guess its not a good one? which should i try to find and how to install it if i want the "good" one?
What exactly did i do? i refreshed some repositories and installed some newer versions of PHP? please explain.
@marko_roi:
Anyway i dont know what to use than, centos debian or ubuntu? first i used ubunut then i read debian is better for stability then i read centOs is mostly used on hosting sites.
so… ? please provide your favourite and why?
This will quickly devolve into a distribution flamewar, and I don't think many of us will bite on it. Sorry
Some stats that might be interesting for comparison:
The good news is that it usually doesn't matter which distribution you run, from a performance or availability standpoint: as long as the software update process is timely and does not break things, it all comes down to personal preferences and the release life cycle policies for your distribution.
@hoopycat:
This will quickly devolve into a distribution flamewar, and I don't think many of us will bite on it. Sorry
;-)
I will! Nothing can defeat the awesome power that is Yggdrasil!
@marko_roi:
Anyway i dont know what to use than, centos debian or ubuntu? first i used ubunut then i read debian is better for stability then i read centOs is mostly used on hosting sites.
so… ? please provide your favourite and why?
Of the ones offered by Linode, the only three I've used are the three you mentioned (CentOS, Ubuntu, and Debian). None of these are my favorite, my favorite isn't offered by Linode.
Of those three, though, I refuse to go near Ubuntu. It is true that Debian has better stability than Ubuntu because Ubuntu tends to push out releases on a strict release cycle, so it's harder for them to test each release rigorously. I remember hearing recently that Ubuntu plans to change their release cycle, so we'll see…
Between Debian and CentOS, they're about the same with how reliable they are. The only reason I would recommend Debian over CentOS is because of their well-known Debian Backports and dotdeb repositories that you can add in, both of which most people know about. CentOS doesn't (to my knowledge) have any well-known third party repositories.
EDIT: If Ubuntu does, some day, become just as stable as Debian and offer users to choose between using sudo or using root, then I won't be so quick to bash them. My experience with Ubuntu hasn't been that great (it does work great for some people, but for myself and most of the people I know, it hardly works at all).
@marko_roi:
Piki Man, thanx I did what you suggested in lower part of your post and now i have "bundled (2.0.34 compatible)" of GD library and problem is gone.
What exactly did i do? i refreshed some repositories and installed some newer versions of PHP? please explain.
You added two extra software repositories, and used these to upgrade the software you had installed. Chances are, GD got updated from either Debian Backports or Dotdeb, which are the two extra repositories you added.
In Debian Backports, software that's already in the Debian Repositories is updated more frequently. Most of the software here is used by normal, every day users.
Dotdeb is basically the same thing, except geared mostly toward server usage, and has a couple extra things added.
EDIT: I edited my post about Debian Backports and dotdeb to explain the commands I gave so you can understand them better.
EDIT 2: Every so often, you should log in to your Linode using the root user and run the following command:
apt-get update && apt-get -t lenny-backports dist-upgrade && apt-get dist-upgrade
It's the same as the upgrade command a few posts up. That will make sure your system is getting all the latest updates, good to do for security. Also good to check any CMS you have installed (such as WordPress or Drupal) for updates by visiting their sites. If they do have an update available, you'll have to follow their instructions for installing the update, and if you need help, chances are there's already a post about it here, and you can ask for help.
Just to know when updating system, currently i dont want to go to php 5.3 as its incompatible with some drupal modules, so php will stick to its current version (5.2) until i decide to manually update it, right?
When you do the 'dist-upgrade', it will show the upgrades it wants to upgrade then pause. You can either type y for yes or n for no and then upgrade manually (apt-get install package1 package2 etc). It seems odd, though, that Drupal modules wouldn't work with PHP 5.3, I'm running Drupal 7 just fine on PHP 5.3. What version of Drupal do you use? If it's not 7.8, definitely upgrade.
Plan ahead, take a snapshot in case anything goes wrong, and then take the necessary steps Upgrading Debian to a new major version is relatively easy. You don't need to redeploy your Linode, and you might not even need to reboot.
… gotta rewrite before 6.0, tho, I know we depend on at least one feature that's going away…
here
@hoopycat:
A guide for how to write your programs such that they avoid problems caused by PHP's changes is available
. here
Har har har, very funny. Try this instead:
James
something
@marko_roi:
Sorry Pik(x)i, honest mistake
:-) about drupal, i have tens of sites and hundred's of modules there and most of them work fine but some don't so i'll stick to 5.2 for some time.
Once again, make sure you're using the latest version of Drupal. Modules written for Drupal 7 should work with PHP 5.3 already.
If you already are using Drupal 7, then I'd be interested to know what those modules are. It would seem strange that Drupal 7 works with PHP 5.3 and the modules wouldn't.