Need help w/ GD & Freetype support for CentOS 5 + PHP5

I’m an amatuer looking for the path with least resistance…

A base install of PHP 5.16 bundled w/ CentOS 5 comes without GD support. For rebuilding PHP, would it be best to just upgrade to PHP 5.2 using the Interworx experimental RPM; the CentOS repo; or Kevin’s tutorial at Steadfast (I’m not their customer.)? I’m trying my best to K.I.S.S. by avoiding third-party RPMs. My only goal for now is to enable GD2 and Freetype with TTF support without creating a missing dependency mess. Necessary libraries for GD, GD2, Freetype 1 & 2 appear to be installed and ready to compile. Thanks to anybody for suggestions.

I’m also curious about ‘–without-mysql’ in my PHP info page when most other MySQL references are ‘–with’ or ‘enabled’.

It’s a whole lot easier than you think!

The GD library is available as a module in yum, so you can just type “yum install php-gd” at the command line, restart apache (service httpd restart) and viola! - you have GD installed for PHP.

Hope that helps
Tim

You weren’t kidding, that was easier than easy. We “every-other-Sunday hackers” have a tendency to over-complicate things. Interesting though-- I had earlier failures with ‘yum install php-gd’ so I guess installing gd dev librarires made the difference, which I don’t understand, but I won’t split that hair.

As for RPMs and repositories, is the Interworx experimental package the only supported one if I ever need to upgrade PHP beyond 5.16? I can think of only one script asking for 5.2 so it won’t be any time soon.

Thanks! Learning something simple is a big leap.

Hi sysnop,

I’ve recently built php 5.2.6 RPMs for CentOS 5 and put them into a repository here:

http://updates.interworx.com/iworx/RPMS/unsupported/php5/

They’re technically unsupported, but as far as I know, they do work and should be fine as a drop in replacement for the default php 5.1.6 that comes with CentOS 5. These are built against MySQL 5.0.22, which is the MySQL version that CentOS installs automatically.

Paul

I’ll probably go after that next time I’m looking for something to break. :slight_smile: Thanks!

haha :slight_smile:

Are there any big advantages to moving out of the CentOS5 default PHP and going to 5.2? Bug fixes? Security Holes?

We’re advised to upgrade and I read somewhere that 64-bit systems in particular stand to benefit most.

http://www.php.net/releases/5_2_0.php

My question is why CentOS5 doesn’t upgrade to this? I know they don’t update as soon as things come out, but they just seem to ignore these updates.

Well, CentOS won’t upgrade to this because they follow redhat’s releases, and redhat’s release policy is something along the lines of (paraphrasing)

“The software version that is released in an OS version will remain that version for the life of that OS version - however, critical and security updates in new releases of the software will be backported and patched against the official OS release version”.

So, in the case of PHP, CentOS 5 will always use PHP 5.1.6 as the “base” version, but they will provide updates to it that are deemed “critical” from newer php updates. That’s my understanding of the redhat policy anyway. What is critical and what isn’t, I’m not sure. But I understand why they do this, they have to talk a line of security and compatiblity in terms of updates.

Paul

Has anybody upgraded to php 5.2.6 using the experimental RPMs? I could use help on the best way to install the essential packages.

Will a yum.conf entry work for updating to php 5.2.6 with experimental RPMs? If so, will a simple yum update take care of it? I’m squeemish about using yum for an experimental update.

Or do I need to use rpm -i one-by-one in a specific order? Or will rpm --force install all dependent packages?

We did it about three days ago on a brand new CentOS 5.2 server.

We downloaded all the rpms, within the folder and then

rpm -ivh php-*.rpm

We hit a few hurdles, but this was more to do with suPHP rather than the PHP itself.

I count 17 individual packages for php 5.1.6 that are currently installed, but there are 24 RPMs in all. Although I reckon it’s a safe bet to replace just the existing 17 for now, does a standard iWorx installation normally use the entire lot? There are packages I don’t need like php-mssql and php-pgsqsl, plus there are numerous dependencies not found by yum (rhe5x & cos5x), even for basic packages like php-common. I’m trying really hard not to add repos from rpmforge, which is how I got around hard-to-find dependencies in the past.

I guess it doesn’t matter if we use -i or -U unless there’s a good reason to use -i. My main question was about how to install multiple RPMs in short hand. It’s now apparent I need to download them and install locally. Apparently, wildcards or the –allfiles switch won’t work unless the RPMs are local. An interesting switch for handling dependencies is –aid, but that only works with http or ftp. I realize I’m over-thinking it.

Thanks! Your reply helps.

Hi Sysnop,

It’s fine to only update the php-* packages you already have installed, but you will have to update all of them that are currently installed. -U makes sense here, since you are in fact “updating” a package. You can download them locally and run the rpm -Uvh *.rpm, or you can specify them each remotely at the command line like

rpm -Uvh full-url-to-rpm1 full-url-to-rpm2

etc. You shouldn’t need to install anything extraneous from rpmforge etc to do this.

Paul

When I first tried installing php-5.2.6-rhe5x.iworx.js.100.i386.rpm it stopped because it depends on php-cli and php-common. I don’t mind installing one-by-one but when I tried installing cli and common (can’t remember which) there were missing dependencies yum was unable to find in a search. That’s what I’m getting at with using an outside repository. I worry that the regular yum repos won’t be able to help if I run into more missing dependencies.

I’ll just jump in the water with all existing pkgs and see what happens. Meanwhile there’s a riddle: Of the 17 installed packages for php 5.1.6, one of them is php-iworx-4.3.9-7.rhe5x.iworx which leaves 16 packages to upgrade to 5.2.6. Should I first uninstall the version 4 package? I started out with CenOS 5 so I don’t understand why it’s there in the first place unless it’s for backward compatibility.

Thanks Paul!

edit: The upgrade was successful. My mistake was listing php-mcrypt in the list of “existing” packages which there are no yum matches for dependencies. In all 15 pkgs installed with no resistance at all. Thanks again.

php-iworx-4.3.9-7.rhe5x.iworx which leaves 16 packages to upgrade to 5.2.6. Should I first uninstall the version 4 package?

The package you mention there is the PHP installation on which Interworx runs. Don’t remove that one, else you might be in for a nasty surprise :wink:

Indeed (lol) and thank you. I came to that conclusion on my own. It pays to be paranoid before issuing a command.

I’m repeating myself here (separate post), but will the next iWorx update have any surprises for me… like putting the stock php 5.1 back?

but will the next iWorx update have any surprises for me… like putting the stock php 5.1 back?

Nope, since 5.2 is “newer” than 5.1, it won’t try to update to 5.1 now that you have 5.2 installed.

Paul

Good to know and thanks.