phpcentosThis Linux installing guide will walk you through installing PHP 5.2.9 (Supports the Kohana Framework) with APC, Memcached, ImageMagick and FFmpeg with AMR (3gp support) on CentOS and RHEL

note: This upgrade also repairs the error

"Warning: preg_match(): Compilation failed: support for \P, \p, and \X has not been compiled at offset 2 in file: /var/www/kohana_2.3.1/system/core/utf8.php on line: 65"

Preliminary Note:

I’m using a CentOS 5.2 x86_64 server with the RPM Forge YUM repo enabled in this tutorial:

* server1.example.co.za (IP 10.0.0.100)

House Keeping

Edit yum.conf and add the ‘exclude’ switch to the configuration and this will eliminate 32bit RPM’s from being installed. You can however ignore this step if you’re installing on a 32bit CentOS or RHEL system.

# vi /etc/yum.conf
[main]
exclude=*.i386 *.i586 *.i686
# yum remove openssl.i686 glibc.i686

If you haven’t installed the RPM Forge CentOS and RHEL repository, here’s how:

# wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

# rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Next we install the various packages that will be required for our PHP Linux installation

# yum install ImageMagick ImageMagick-devel memcached zlib-devel php-pear \
  httpd-devel gcc mysql-devel libxslt-devel php-xsl re2c ffmpeg ffmpeg-devel lame amrnd \
  php php-cli php-common php-devel php-gd php-mbstring php-mysql php-odbc php-pdo \
  php-pgsql php-snmp php-xml php-xmlrpc php-soap php-imap

# chkconfig memcached on

NB. Don’t forget to read through the installing guide for FFmpeg with AMR support before continuing.

PECL install the relevant .so modules required by PHP

# pecl install memcache

# pecl install apc

# pecl install PDO

# pecl install pdo_mysql

# pecl install imagick

# pecl install xslcache

and download the source and install the .so files not available via PECL

# wget http://garr.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.6.0.tbz2

# tar -xjf ffmpeg-php-0.6.0.tbz2

# cd ffmpeg-php-0.6.0

# phpize
# ./configure
# make
# make install

Create inclusion files for all the .so modules

# echo "extension=xslcache.so" > /etc/php.d/xslcache.ini

# echo "extension=apc.so" > /etc/php.d/apc.ini

# echo "extension=pdo.so" > /etc/php.d/pdo.ini

# echo "extension=pdo_mysql.so" > /etc/php.d/pdo_mysql.ini

# echo "extension=memcache.so" > /etc/php.d/memcache.ini

# echo "extension=mcrypt.so" > /etc/php.d/mcrypt.ini

# echo "extension=imagick.so" > /etc/php.d/imagick.ini

# echo "extension=ffmpeg.so" > /etc/php.d/ffmpeg.ini

Upgrade to PHP 5.2.9
Download the latest PHP RPM’s from Oracle’s website and YUM upgrade your existing PHP installation.

# wget http://oss.oracle.com/projects/php/dist/files/EL5/x86_64/all-php-5.2.9-1.el5.x86_64.tgz

# tar zxvf all-php-5.2.9-1.el5.x86_64.tgz

# cd ./x86_64/

# yum upgrade php-5.2.9-1.el5.x86_64.rpm php-cli-5.2.9-1.el5.x86_64.rpm php-common-5.2.9-1.el5.x86_64.rpm \
   php-devel-5.2.9-1.el5.x86_64.rpm php-gd-5.2.9-1.el5.x86_64.rpm \
   php-mbstring-5.2.9-1.el5.x86_64.rpm php-mysql-5.2.9-1.el5.x86_64.rpm \
   php-odbc-5.2.9-1.el5.x86_64.rpm php-pdo-5.2.9-1.el5.x86_64.rpm php-pgsql-5.2.9-1.el5.x86_64.rpm \
   php-snmp-5.2.9-1.el5.x86_64.rpm php-xml-5.2.9-1.el5.x86_64.rpm \
   php-xmlrpc-5.2.9-1.el5.x86_64.rpm php-soap-5.2.9-1.el5.x86_64.rpm php-imap-5.2.9-1.el5.x86_64.rpm
# vi /var/www/html/phpinfo.php



Restart httpd/apache and point your browser at http://your-web-server/phpinfo.php and confirm your installation.

[ad#3]

Related posts:

  1. Installing #FFmpeg with #AMR on #CentOS 5.x 64 bit
  2. Installing #Cherokee with #PHP 5.2.10 and MySQL Support On #CentOS 5.3
  3. #XSLCache is in #PECL
  4. CentOS: The most popular Linux distribution for web servers

Tagged with:  

View Comments to “Installing and upgrading to #PHP 5.2.9 on #CentOS and #RedHat Linux 5.3 x86_64”

  1. [...] have modified the linux installing guide, Installing and upgrading to PHP 5.2.9 on CentOS and Red Hat Linux 5.3 x86_64 to reflect this change. Share and [...]

  2. Wished it worked... says:

    The link is dead….

    wget http://oss.oracle.com/projects/php/dist/files/E...

Leave a Reply

blog comments powered by Disqus
Get Adobe Flash playerPlugin by wpburn.com wordpress themes
Afrigator
Blog WebMastered by All in One Webmaster.