# Interworx repository's php-5.2.0 SRPM: How to compile 5.2.5?

**URL:** <https://forums.interworx.com/t/interworx-repositorys-php-5-2-0-srpm-how-to-compile-5-2-5/12008>\
**Category:** Hacks / Tools / Tips / Tricks\
**Created:** [December 31, 2007, 9:34am UTC](https://forums.interworx.com/t/interworx-repositorys-php-5-2-0-srpm-how-to-compile-5-2-5/12008 "2007-12-31T09:34:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimp](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jimp](https://forums.interworx.com/u/jimp)\
**Post date:** [December 31, 2007, 9:34am UTC](https://forums.interworx.com/t/interworx-repositorys-php-5-2-0-srpm-how-to-compile-5-2-5/12008/1 "2007-12-31T09:34:43Z")

</div>

I found [Interworx’s PHP 5.2.0 SRPM](http://updates.interworx.info/iworx/SRPMS/experimental/php-5.2.0-100.iworx.src.rpm). It compiles fine, thanks! However, our custom CMS is not compatible with PHP 5.2.0 because of a serious bug with \_\_get() and \_\_set() that was not present in \< 5.2.0 and fixed under 5.2.1+.

In the past, with the PHP 5.1.2 SPRM, I was able to install it, edit the spec file so it would compile the latest PHP version, place the correct PHP source tarball in place, and build the newest version. This does not seem to work with the 5.2.0 SRPM. I have tried my method for 5.2.5 and 5.2.4, and both error out claiming “sapi/cgi/php” does not exist during a copy operation. This command is on line 1,031 of the spec file.

```auto
# Install from CGI tree
pushd build-cgi
%{__make} \
    install \
    INSTALL_ROOT=%{buildroot}
cp -f sapi/cli/php %{buildroot}%{_bindir}/php-cli
cp -f sapi/cgi/php %{buildroot}%{_bindir}/php-cgi
rm -f %{buildroot}%{_bindir}/php
pushd %{buildroot}%{_bindir}
ln -fs php-cgi php
popd
popd

```

Unfortunately, nothing I have tried has fixed this problem. I have successfully compiled SRPM’s from a couple other repositories out there, but they did not compile a CGI binary at all (CLI instead), and I’d rather stay with the Interworx package if at all possible. Could someone please help me figure out why the Interworx PHP-5.2.0 SRPM seems to be an invalid starting point for compiling the current version of PHP (5.2.5)?

---

<div class="post-metadata">

**Author:** ![Paul](https://forums.interworx.com/user_avatar/forums.interworx.com/paul/32/6_2.png) [@Paul](https://forums.interworx.com/u/Paul)\
**Post date:** [December 31, 2007, 11:37am UTC](https://forums.interworx.com/t/interworx-repositorys-php-5-2-0-srpm-how-to-compile-5-2-5/12008/2 "2007-12-31T11:37:50Z")

</div>

Hi Jimp,

Try changing the line:

cp -f sapi/cgi/php %{buildroot}%{\_bindir}/php-cgi

To:

cp -f sapi/cgi/php-cgi %{buildroot}%{\_bindir}/php-cgi

And see if that helps.

Paul

---

<div class="post-metadata">

**Author:** ![jimp](https://forums.interworx.com/letter_avatar_proxy/v4/letter/j/8baadc/32.png) [@jimp](https://forums.interworx.com/u/jimp)\
**Post date:** [December 31, 2007, 12:21pm UTC](https://forums.interworx.com/t/interworx-repositorys-php-5-2-0-srpm-how-to-compile-5-2-5/12008/3 "2007-12-31T12:21:03Z")

</div>

That fixed it. Thanks, Paul! 🆒
