Recompiling PHP that was installed from RPM package?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Kreshna
Forum Newbie
Posts: 7
Joined: Mon Nov 02, 2009 10:50 pm

Recompiling PHP that was installed from RPM package?

Post by Kreshna »

I need to recompile an existing PHP installation, but the PHP was installed from RPM package.

Is it possible to recompile such RPM-installed PHP? And if that's the case, what things should I anticipate? What potential problems I'm going to face?

I'm quite familiar in compiling from scratch, but I have never re-compiled anything before. I'm also unfamiliar with RPM. Should I use the usual ./make and /make install command, or should I use RPM instead? Can RPM recompile things?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Re: Recompiling PHP that was installed from RPM package?

Post by Weirdan »

There are two kinds of RPM packages - installable binary packages (.rpm) that do not contain the source code but only compiled binaries/libraries/etc and source rpm packages (.src.rpm) that are used to build binary packages. You need the latter to be able to recompile anything. Refer to this page for a little more in-depth introduction: http://www.rpm.org/max-rpm/s1-rpm-misce ... srpms.html
User avatar
Kreshna
Forum Newbie
Posts: 7
Joined: Mon Nov 02, 2009 10:50 pm

Re: Recompiling PHP that was installed from RPM package?

Post by Kreshna »

Weirdan wrote:and source rpm packages (.src.rpm) that are used to build binary packages. You need the latter to be able to recompile anything. Refer to this page for a little more in-depth introduction: http://www.rpm.org/max-rpm/s1-rpm-misce ... srpms.html
Thanks, Weirdan. By the way, I skimmed through the pages, but there's still one thing I haven't found yet:

Does the existing PHP installation need to be installed from source RPM to be able to recompiled? What if the existing PHP was installed from compiled binary RPM? Can I just download the source RPM elsewhere (of the same version, of course), and then compile it over the existing PHP installation?
Post Reply