PHP 5.2 on CentOS5
If you're looking for PHP 5.2.x RPMs for CentOS5, try these:
http://remi.collet.free.fr/rpms/el5.i386/
Installing PHP 5.1 On RHEL4
You can instlal PHP 5.1 from the centosplus repository:
{
if ! grep -qai '^rpm "http://mirror.centos.org/centos"' /etc/apt/sources.list ; then
echo 'rpm "http://mirror.centos.org/centos" /4/apt/i386 os updates addons centosplus' >> /etc/apt/sources.list
fi
sed --in-place 's%^rpm http://apt.rimuhosting.com rhel/4%#rpm http://apt.rimuhosting.com rhel/4%' /etc/apt/sources.list
sed --in-place 's%^rpm-src http://apt.rimuhosting.com rhel/4%#rpm-src http://apt.rimuhosting.com rhel/4%' /etc/apt/sources.list
apt-get update
apt-get install -y php php-xml
#sed --in-place 's%^rpm "http://mirror.centos.org/centos"%#rpm "http://mirror.centos.org/centos"%' /etc/apt/sources.list
}If your upgrading from php4, substitute apt-get dist-upgrade php, instead of the apt-get install command.
RPM-based install of PHP5.1 onto a WBEL3 Distro (Deprecated?)
This one has not been tried for a while. And odds are it may no longer work (e.g. the repositories that it points to may have changed their contents).
function installphp51() {version=5.1.6-1.2.1pearversion=1.4.9-1.2# get the rpm packages you have installed. e.g. php-mysql, php-gdrpms=$(rpm -qa | grep php- | sed 's/-4.*//g' | grep -v ioncube); # not a dependa
ncy in PHP4 is in PHP5 so ensure it is one of the rpms we installrpms="$rpms php-pear php-pdo"rhelversion=rhel4rheldir=4ESpv="centos"mirror="http://mirror.centos.org/centos/4.4/centosplus/i386/RPMS/"if [ ! -e /etc/redhat-release ] ; thenecho "This howto only works on rhel based distros" >&2return 1fiif grep -qai 3.0 /etc/redhat-release; thenrhelversion=rhel3rheldir=3ESwget 'http://dag.wieers.com/packages/libxml2/libxml2-2.6.16-1.1.el3.rf.i386.rpm'if [ $? -ne 0 ]; thenecho "failed getting necessary libxml2.6" >&2return 1firpm -Uvfh libxml2-2.6.16-1.1.el3.rf.i386.rpmif [ $? -ne 0 ]; thenecho "failed installing necessary libxml2.6" >&2return 1fimirror="http://mirror.cheetaweb.com/redhat/$rheldir/i386/RPMS.php51/"pv="ct"fiif grep -qai 4 /etc/redhat-release; then rpm -Uvh "http://mirror.centos.org/centos/4.4/os/i386/CentOS/RPMS/sqlite-3.3.3-1.2.i386.rpm" if [ $? -ne 0 ]; then echo "failed to install sqlite package."; return 1; fififullrpms= mkdir php51; cd php51;for i in $rpms; doif [ "$i" = "php-pear" ]; thenfile=php-pear-$pearversion.$pv.noarch.rpmelsefile=$i-$version.$pv.i386.rpmfifullrpms=$(echo $fullrpms $file)if [ -e $file ] ; then continue; fiwget "$mirror/$file"if [ $? -ne 0 ] ; then echo "failed getting " "$mirror""$file"; return 1;fidoneecho rpms= $fullrpms# install the newer versions of each of those rpmsrpm -Uvfh $fullrpmsif [ $? -ne 0 ]; then echo "failed installing rpms"; return 1; fireplace "php4" "php5" -- /etc/httpd/conf.d/php.conf}installphp51