Koozali.org: home of the SME Server

Upgrade to PHP 4.3.10 with curl Support in SME 6.5RC1

erwand

Upgrade to PHP 4.3.10 with curl Support in SME 6.5RC1
« on: March 02, 2005, 11:00:14 AM »
Here is the script i use to upgrade PHP

#!/bin/sh
# Erwan Desvergnes erwan.desvergnes@andium.fr
# 2005-03-02 Updated - For Curl Support On SME 6.5 RC1
# 2005-02-05 Updated - with packages for curl, mcrypt, mhash, domxml, xmlrpc
# 2005-02-02 Updated - with own RPMS basically same options as DanBrown and Laurent Dinclaux
#
# 2004-05-12 Updated - with Dan Brown's PHP RPMS
#
# 2004-12-24 Rigger
# Udated for php release 4.3.10
# There are NO builds manual for 4.3.10 at the known download location
# so uncommenting to install package will not work.
# Changed unixODBC download to the fedoralegacy site.
#
# 2004-09-29 Laurent Dinclaux relased php-4.3.9
# I have released PHP 4.3.9 RPMs. In addition of Dan Brown releases:
# - Curl extension
# - Compiled with options
#     --enable-sockets --enable-pcntl --enable-sigchild
#
# Based on Rigger's (Doug Musty <doug@musty.us>) script & Dan Brown's RPMS
# 2004-07-23 Latest update from Rigger   
# Recognize that the unixODBC package is already installed and skip downloading it...
# Also changed the pear install commands to pear upgrade. This will stop the failure
# notice if already installed and will still install the package if not installed already.

echo "Upgrading your PHP to version 4.3.10..." | tee php_upg.log
mkdir phpupgrade
cd phpupgrade

wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/ldinclaux/SME6.x/Contribs/PHP/4.3.10/php-4.3.10-3ld_rh73.i386.rpm -a php_upg.log
wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/ldinclaux/SME6.x/Contribs/PHP/4.3.10/php-curl-4.3.10-3ld_rh73.i386.rpm -a php_upg.log
wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/ldinclaux/SME6.x/Contribs/PHP/4.3.10/php-devel-4.3.10-3ld_rh73.i386.rpm -a php_upg.log
wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/ldinclaux/SME6.x/Contribs/PHP/4.3.10/php-imap-4.3.10-3ld_rh73.i386.rpm -a php_upg.log
wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/ldinclaux/SME6.x/Contribs/PHP/4.3.10/php-ldap-4.3.10-3ld_rh73.i386.rpm -a php_upg.log
wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/ldinclaux/SME6.x/Contribs/PHP/4.3.10/php-mysql-4.3.10-3ld_rh73.i386.rpm -a php_upg.log
wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/ldinclaux/SME6.x/Contribs/PHP/4.3.10/php-odbc-4.3.10-3ld_rh73.i386.rpm -a php_upg.log


# Uncomment next line if you are using postgre sql
# wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/ldinclaux/SME6.x/Contribs/PHP/4.3.10/php-pgsql-4.3.10-3ld_rh73.i386.rpm -a php_upg.log

# Uncomment next line if you are using SNMP
# wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/ldinclaux/SME6.x/Contribs/PHP/4.3.10/php-snmp-4.3.10-3ld_rh73.i386.rpm -a php_upg.log

# Uncomment next line if you are using mcrypt
# wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/ldinclaux/SME6.x/Contribs/PHP/4.3.10/php-mcrypt-4.3.10-3ld_rh73.i386.rpm -a php_upg.log

# Uncomment next line if you want to install the manual.
# wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/ldinclaux/SME6.x/Contribs/PHP/4.3.10/php-manual-4.3.10-3ld_rh73.i386.rpm -a php_upg.log

wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/cgenner/RPMS/i386/curl-7.9.8-6.i386.rpm
wget -nc -nd -S http://www.ibiblio.org/pub/Linux/distributions/smeserver/contribs/ldinclaux/SME6.x/Contribs/RPMS/i386/curl-devel-7.9.8-6.i386.rpm


# Install unixOBDC if not installed.
rpm -qa > rpmlist

IS_ODBC=pic rpmlist | grep -c unixODBC

if [ $IS_ODBC -eq 0 ]
then
   wget -nc -nd -S http://download.fedoralegacy.org/redhat/7.3/os/i386/unixODBC-2.2.0-5.i386.rpm -a php_upg.log
else
   echo "unixODBC installed skipping download"
fi

rpm -Uvh --nodeps *.rpm

mkdir -p /etc/e-smith/templates-custom/etc/php.ini
touch /etc/e-smith/templates-custom/etc/php.ini/50PathsDirectories
echo 'include_path        = ".:/usr/share/pear:/usr/include/curl"' > /etc/e-smith/templates-custom/etc/php.ini/50PathsDirectories
echo 'doc_root            =' >> /etc/e-smith/templates-custom/etc/php.ini/50PathsDirectories
echo 'user_dir            =' >> /etc/e-smith/templates-custom/etc/php.ini/50PathsDirectories
echo 'extension_dir       = /usr/lib/php4' >> /etc/e-smith/templates-custom/etc/php.ini/50PathsDirectories
echo 'enable_dl           = On' >> /etc/e-smith/templates-custom/etc/php.ini/50PathsDirectories
echo 'extension           = curl.so' >> /etc/e-smith/templates-custom/etc/php.ini/50PathsDirectories

pear upgrade Log
pear upgrade Date

/sbin/e-smith/expand-template /etc/php.ini

# service httpd restart
# Modified after requtest from contribs.org forum
/etc/e-smith/events/actions/restart-httpd-full

rm * -f
cd ..
rmdir phpupgrade

echo " DONE........"