[ start | index | login ]
start > knowledgebase > linux > miscapplications > rpm based php5.1 install

rpm based php5.1 install

Created by retep. Last edited by retep, 214 days ago. Viewed 4,454 times. #41
[diff] [history] [edit] [rdf]
labels
attachments

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.1

pearversion=1.4.9-1.2

# get the rpm packages you have installed. e.g. php-mysql, php-gd

rpms=$(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 install

rpms="$rpms php-pear php-pdo"

rhelversion=rhel4

rheldir=4ES

pv="centos"

mirror="http://mirror.centos.org/centos/4.4/centosplus/i386/RPMS/"

if [ ! -e /etc/redhat-release ] ; then

echo "This howto only works on rhel based distros" >&2

return 1

fi

if grep -qai 3.0 /etc/redhat-release; then

rhelversion=rhel3

rheldir=3ES

wget 'http://dag.wieers.com/packages/libxml2/libxml2-2.6.16-1.1.el3.rf.i386.rpm'

if [ $? -ne 0 ]; then

echo "failed getting necessary libxml2.6" >&2

return 1

fi

rpm -Uvfh libxml2-2.6.16-1.1.el3.rf.i386.rpm

if [ $? -ne 0 ]; then

echo "failed installing necessary libxml2.6" >&2

return 1

fi

mirror="http://mirror.cheetaweb.com/redhat/$rheldir/i386/RPMS.php51/"

pv="ct"

fi

if 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; fi

fi

fullrpms= mkdir php51; cd php51;

for i in $rpms; do

if [ "$i" = "php-pear" ]; then

file=php-pear-$pearversion.$pv.noarch.rpm

else

file=$i-$version.$pv.i386.rpm

fi

fullrpms=$(echo $fullrpms $file)

if [ -e $file ] ; then continue; fi

wget "$mirror/$file"

if [ $? -ne 0 ] ; then echo "failed getting " "$mirror""$file"; return 1;

fi

done

echo rpms= $fullrpms

# install the newer versions of each of those rpms

rpm -Uvfh $fullrpms

if [ $? -ne 0 ]; then echo "failed installing rpms"; return 1; fi

replace "php4" "php5" -- /etc/httpd/conf.d/php.conf

}

installphp51

请以发表评论身份登录
Powered by snipsnap.org Found a mistake in a howto? Let us know via an email to p.blikibugs at rimuhosting com.