PHP 5.2 on CentOS 4
The PHP version provided by CentOS 4 is 5.1, but some PHP based application such as Magento need PHP 5.2. The simplest way is build the PHP 5.2 rpm from php-5.2.6-2.fc7.src.rpm. These are the way to solve the issues when rpmbuild:
Solve the “checking for C compiler default output file name… configure: error: C compiler cannot create executables” issue:
Change this line in php.spec:
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -Wno-pointer-sign"
to:
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
Solve the “configure: error: The PCRE extension requires PCRE library version >= 6.6″ issue:
Build and install the pcre-7.3-3.fc7.src.rpm first.