Unfortunately the php 5.2.17 version can no longer be installed from repos, sad but that’s how it is with old versions. Well the only way here is to manually compile php.

First make sure you have gcc, make and httpd-devel libxml2-devel bzip2-devel openssl-devel curl-devel gd-devel libc-client-devel libmcrypt-devel libmhash-devel mysql55-devel aspell-devel libxslt-devel installed as these are needed:

Installing required packages

  • PowerShell

    yum install gcc make httpd-devel libxml2-devel bzip2-devel openssl-devel curl-devel gd-devel libc-client-devel libmcrypt-devel libmhash-devel mysql55-devel aspell-devel libxslt-devel

Then we start by downloading the package php-5.2.17.tar.gz

Downloading php 5.2.17 source

wget http://museum.php.net/php5/php-5.2.17.tar.gz tar -zxvf php-5.2.17.tar.gz cd php-5.2.17

We will now need to configure it, I’ve added –with-apxs2=/usr/sbin/apxs to add mod_php directly to apache. It should then work with your normal apache installation as long as you are only using mod_php. Compiling php centos 6

./configure --prefix=/usr/local/php52 --with-apxs2=/usr/sbin/apxs --with-config-file-path=/usr/local/lib/php52/  --disable-posix   --enable-bcmath   --enable-calendar   --enable-exif   --enable-fastcgi   --enable-ftp   --enable-gd-native-ttf   --enable-libxml   --enable-magic-quotes   --enable-mbstring   --enable-pdo   --enable-soap   --enable-sockets   --enable-wddx   --enable-zip  --with-bz2   --with-curl   --with-curlwrappers   --with-freetype-dir   --with-gd   --with-gettext   --with-imap   --with-imap-ssl  --with-jpeg-dir  --with-kerberos   --with-libexpat-dir   --with-libxml-dir  --with-libxml-dir   --with-mcrypt   --with-mhash   --with-mime-magic   --with-mysql  --with-mysqli   --with-openssl --with-openssl-dir --with-pcre-regex  --with-pdo-mysql   --with-pdo-sqlite   --with-pic   --with-png-dir   --with-pspell   --with-sqlite   --with-ttf   --with-xmlrpc   --with-xpm-dir  --with-xsl --with-zlib   --with-zlib-dir

The result should be similar to:

| This software is subject to the PHP License, available in this distribution in the file LICENSE.  By continuing this installation | | process, you are bound by the terms of this license agreement. If you do not agree with the terms of this license, you must abort the installation process at this point.+--------------------------------------------------------------------+
Thank you for using PHP.

Then run the make and make install to compile it and install php on your system.

Compiling php 5.2.17

PowerShell make clean make -j 2 make install

The end result would have php working on your server, bellow is a phpinfo() page:

Apache 2 and phpinfo page

Apache 2 and phpinfo page


This article was last modified: June 3, 2016, 8:30 a.m.

0 Comments

Please log in to leave a comment.

Add or change tags.

A comma-separated list of tags.

Share

Hacker News

Top