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

I found Interworx’s PHP 5.2.0 SRPM. 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.

# 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)?

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

That fixed it. Thanks, Paul! :cool: