Re: PHP recompiling

From: J.O. Aho (user_at_example.net)
Date: 09/09/03


Date: Tue, 09 Sep 2003 16:56:12 +0200

Alexander Dalloz wrote:

> You should take the PHP src.rpm from RH 9. It is easy to add mcrypt
> module support to it. But compiling a newer version of PHP is not
> trivial, so be aware that you might fail.

It's not that difficult to compile a new version with help of an older source
rpm, then only problem will be the patches, some of them aren't needed anymore.

First, "install" the source package:
rpm -ivh php-x.y.z-q.src.rpm

CD to the directory with spec files:
cd /usr/src/redhat/SPECS

Now you need to edit the spec file, it's not that much you really need to do,
first you need to update the version number:

Version: 4.3.1

When you done that, you scroll futher down and you find the line starting with
'./configure' and the rows beneath it are part of the configure line too, as
'\' tells that continues on next line.
Here you add the option for compile the mcrypt (for the option name, do a
./configure --help).

Save your php.spec and copy the new tarball of php to /usr/src/redhat/SOURCE.

What's left now, is to know which patches to include or not. As I'm quite
lazy, I start to build the new RPM, it will notify me if a patch can't be
applied, then break the RPM (ctrl-c) and comment the line in the php.spec file
that applies the patch.

#%patch3 -p1

And then build the RPM again, repeat the previous step untill all patches that
are uncommented are applied to the source.

And hopefully you have all the requiered devel packages installed, and the RPM
will be built and all the RPMs are then found in /usr/src/redhat/RPMS/i386.

To build a RPM: rpmbuild -ba /usr/src/redhat/SPECS/php.spec

Don't forget, after the RPMs are built, you need to install them (don't
install the sourcerpm that is built too).

  //Aho



Relevant Pages

  • Re: Got it working! First post from inside Damn Small Linux! Need more help pls
    ... install Linux, so I'll install Puppy rather than D.S.L. initially as ... "root" that you click on and it takes you to the root via a shell ... RPM package format because of the need to ... privileges are not needed by an ordinary user to compile and install ...
    (comp.os.linux.setup)
  • Re: Whats the difference?
    ... What is the difference between a RPM package and a tar.gz package? ... will contain source code, so you can compile the software they contain, ... You normally use a package management system to install the ...
    (alt.os.linux.suse)
  • Re: dependency problems w/mailscanner
    ... I guess I'll just download the new version and compile the ... >> I am a little disappointed in rpm at the moment. ... I did finally get MailScanner to install. ...
    (RedHat)
  • Re: PHP recompiling
    ... It's not that difficult to compile a new version with help of an older source ... rpm, then only problem will be the patches, some of them aren't needed anymore. ... will be built and all the RPMs are then found in /usr/src/redhat/RPMS/i386. ... Don't forget, after the RPMs are built, you need to install them (don't ...
    (linux.redhat)
  • Re: how to use Redhats glibc SRPMs?
    ... > planning to compile from this source as I need to modify certain ... When I unpack the RPM, ... Sorry, but I'm not sure if glibc for RH 8 witll work with Fedora,but: ... If you use rpm to install the src.rpm, and have rpm-build installed, ...
    (RedHat)