Here, we are installing the PHP 5.2.17 version as second PHP on server.
Download PHP 5.2.17 under /usr/src directory.
wget http://museum.php.net/php5/php-5.2.17.tar.bz2
tar -jxvf php-5.2.17.tar.bz2
cd php-5.2.17
Use the below command to check the modules configured with the current PHP version.
php -i | grep configure
Configure Command => './configure' '--disable-cgi' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-sockets' '--enable-zip' '--prefix=/usr/local' '--with-bz2' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-
imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2/' '--
with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pic' '--with-png-dir=/usr' '--with-sqlite=shared' '--with-tidy=/opt/tidy/' '--with-ttf' '--with-xmlrpc' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr'
You will get a output with quotes. You need to remove the quotes from the output and the configure command should look like below.
Required output:
./configure --disable-cgi --enable-bcmath --enable-calendar --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-magic-quotes --enable-mbstring --enable-pdo=shared --enable-sockets --enable-zip --prefix=/usr/local --with-bz2 --with-curl=/opt/curlssl/ --with-freetype-dir=/usr --with-gd --with-imap=/opt/php_with_imap_client/ --with-imap-
ssl=/usr --with-jpeg-dir=/usr --with-kerberos --with-libdir=lib64 --with-libexpat-dir=/usr --with-libxml-dir=/opt/xml2/ --with-mcrypt=/opt/libmcrypt/ --with-mysql=/usr --with-
mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/bin/mysql_config --with-openssl=/usr --with-openssl-dir=/usr --with-pcre-regex=/opt/pcre --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-pic --with-png-dir=/usr --with-sqlite=shared --with-tidy=/opt/tidy/ --with-ttf --with-xmlrpc --with-xpm-dir=/usr --with-xsl=/opt/xslt/ --with-zlib --with-zlib-dir=/usr
Add the below entry next to the prefix option:
--with-config-file-path=/opt/php52/lib --with-config-file-scan-dir=/opt/php52/lib/php.ini.d
Execute the configure command now:
./configure --disable-cgi --enable-bcmath --enable-calendar --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-magic-quotes --enable-mbstring --enable-pdo=shared --enable-sockets --enable-zip --prefix=/opt/php52 --with-config-file-path=/opt/php52/lib --with-config-file-scan-dir=/opt/php52/lib/php.ini.d --with-bz2 --with-curl=/opt/curlssl/
--with-freetype-dir=/usr --with-gd --with-imap=/opt/php_with_imap_client/ --with-imap-ssl=/usr --with-jpeg-dir=/usr --with-kerberos --with-libdir=lib64 --with-libexpat-dir=/usr --with-libxml-dir=/opt/xml2/ --with-mcrypt=/opt/libmcrypt/ --with-mysql=/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/bin/mysql_config --with-
openssl=/usr --with-openssl-dir=/usr --with-pcre-regex=/opt/pcre --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-pic --with-png-dir=/usr --with-sqlite=shared --with-tidy=/opt/tidy/ --with-ttf --with-xmlrpc --with-xpm-dir=/usr --with-xsl=/opt/xslt/ --with-zlib --with-zlib-dir=/usr
The config command will complete successfully.
make
You may face the below error while running the make command:
/usr/src/php-5.2.17/ext/dom/node.c: In function ‘dom_canonicalization’:
/usr/src/php-5.2.17/ext/dom/node.c:1953: error: dereferencing pointer to incomplete type
/usr/src/php-5.2.17/ext/dom/node.c:1955: error: dereferencing pointer to incomplete type
make: *** [ext/dom/node.lo] Error 1
Use the below steps to overcome this error.
wget https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt
patch -p0 -b < txtbgxGXAvz4N.txt
Now you need to run the make command once again. Once it completed follow the below steps.
make install
cp php.ini-recommended /opt/php52/lib/php.ini
Add the below entry under the [handlers] section at the end of the file.
vi /opt/suphp/etc/suphp.conf
application/x-httpd-php52="php:/opt/php52/bin/php-cgi"
vi /usr/local/apache/conf/php.conf
suPHP_AddHandler application/x-httpd-php52
/etc/init.d/httpd restart
Add the below entry in the domain .htaccess file for which you need to use the PHP 5.2.17 version:
AddHandler application/x-httpd-php52 .php
To compile the additional modules with the PHP 5.2.17 version:
Add extension Directory on server.
echo 'extension_dir="/opt/php52/lib/php/extensions/no-debug-non-zts-20060613"' >> /opt/php52/lib/php.ini
Ioncube Installation:
Download link: http://www.ioncube.com/loaders.php
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
cp -rpf ioncube/ioncube_loader_lin_5.2.so /opt/php52/lib/php/extensions/no-debug-non-zts-20060613/
echo 'zend_extension="/opt/php52/lib/php/extensions/no-debug-non-zts-20060613/ioncube_loader_lin_5.2.so"' >> /opt/php52/lib/php.ini
Zend_Optimizer Installation:
wget http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
tar -zxvf ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
cp -rpf ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so /opt/php52/lib/php/extensions/no-debug-non-zts-20060613/
echo 'zend_extension="/opt/php52/lib/php/extensions/no-debug-non-zts-20060613/ZendOptimizer.so"' >> /opt/php52/lib/php.ini
Then, add extension directive for the below modules which are already compliled.
PDO
pdo_mysql
pdo_sqlite
SQLite
echo 'extension = "pdo.so"' >> /opt/php52/lib/php.ini
echo 'extension = "pdo_mysql.so"' >> /opt/php52/lib/php.ini
echo 'extension = "pdo_sqlite.so"' >> /opt/php52/lib/php.ini
echo 'extension = "sqlite.so"' >> /opt/php52/lib/php.ini
Download PHP 5.2.17 under /usr/src directory.
wget http://museum.php.net/php5/php-5.2.17.tar.bz2
tar -jxvf php-5.2.17.tar.bz2
cd php-5.2.17
Use the below command to check the modules configured with the current PHP version.
php -i | grep configure
Configure Command => './configure' '--disable-cgi' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-magic-quotes' '--enable-mbstring' '--enable-pdo=shared' '--enable-sockets' '--enable-zip' '--prefix=/usr/local' '--with-bz2' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-
imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libexpat-dir=/usr' '--with-libxml-dir=/opt/xml2/' '--
with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pic' '--with-png-dir=/usr' '--with-sqlite=shared' '--with-tidy=/opt/tidy/' '--with-ttf' '--with-xmlrpc' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr'
You will get a output with quotes. You need to remove the quotes from the output and the configure command should look like below.
Required output:
./configure --disable-cgi --enable-bcmath --enable-calendar --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-magic-quotes --enable-mbstring --enable-pdo=shared --enable-sockets --enable-zip --prefix=/usr/local --with-bz2 --with-curl=/opt/curlssl/ --with-freetype-dir=/usr --with-gd --with-imap=/opt/php_with_imap_client/ --with-imap-
ssl=/usr --with-jpeg-dir=/usr --with-kerberos --with-libdir=lib64 --with-libexpat-dir=/usr --with-libxml-dir=/opt/xml2/ --with-mcrypt=/opt/libmcrypt/ --with-mysql=/usr --with-
mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/bin/mysql_config --with-openssl=/usr --with-openssl-dir=/usr --with-pcre-regex=/opt/pcre --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-pic --with-png-dir=/usr --with-sqlite=shared --with-tidy=/opt/tidy/ --with-ttf --with-xmlrpc --with-xpm-dir=/usr --with-xsl=/opt/xslt/ --with-zlib --with-zlib-dir=/usr
Add the below entry next to the prefix option:
--with-config-file-path=/opt/php52/lib --with-config-file-scan-dir=/opt/php52/lib/php.ini.d
Execute the configure command now:
./configure --disable-cgi --enable-bcmath --enable-calendar --enable-ftp --enable-gd-native-ttf --enable-libxml --enable-magic-quotes --enable-mbstring --enable-pdo=shared --enable-sockets --enable-zip --prefix=/opt/php52 --with-config-file-path=/opt/php52/lib --with-config-file-scan-dir=/opt/php52/lib/php.ini.d --with-bz2 --with-curl=/opt/curlssl/
--with-freetype-dir=/usr --with-gd --with-imap=/opt/php_with_imap_client/ --with-imap-ssl=/usr --with-jpeg-dir=/usr --with-kerberos --with-libdir=lib64 --with-libexpat-dir=/usr --with-libxml-dir=/opt/xml2/ --with-mcrypt=/opt/libmcrypt/ --with-mysql=/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/bin/mysql_config --with-
openssl=/usr --with-openssl-dir=/usr --with-pcre-regex=/opt/pcre --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-pic --with-png-dir=/usr --with-sqlite=shared --with-tidy=/opt/tidy/ --with-ttf --with-xmlrpc --with-xpm-dir=/usr --with-xsl=/opt/xslt/ --with-zlib --with-zlib-dir=/usr
The config command will complete successfully.
make
You may face the below error while running the make command:
/usr/src/php-5.2.17/ext/dom/node.c: In function ‘dom_canonicalization’:
/usr/src/php-5.2.17/ext/dom/node.c:1953: error: dereferencing pointer to incomplete type
/usr/src/php-5.2.17/ext/dom/node.c:1955: error: dereferencing pointer to incomplete type
make: *** [ext/dom/node.lo] Error 1
Use the below steps to overcome this error.
wget https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt
patch -p0 -b < txtbgxGXAvz4N.txt
Now you need to run the make command once again. Once it completed follow the below steps.
make install
cp php.ini-recommended /opt/php52/lib/php.ini
Add the below entry under the [handlers] section at the end of the file.
vi /opt/suphp/etc/suphp.conf
application/x-httpd-php52="php:/opt/php52/bin/php-cgi"
vi /usr/local/apache/conf/php.conf
suPHP_AddHandler application/x-httpd-php52
/etc/init.d/httpd restart
Add the below entry in the domain .htaccess file for which you need to use the PHP 5.2.17 version:
AddHandler application/x-httpd-php52 .php
To compile the additional modules with the PHP 5.2.17 version:
Add extension Directory on server.
echo 'extension_dir="/opt/php52/lib/php/extensions/no-debug-non-zts-20060613"' >> /opt/php52/lib/php.ini
Ioncube Installation:
Download link: http://www.ioncube.com/loaders.php
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
cp -rpf ioncube/ioncube_loader_lin_5.2.so /opt/php52/lib/php/extensions/no-debug-non-zts-20060613/
echo 'zend_extension="/opt/php52/lib/php/extensions/no-debug-non-zts-20060613/ioncube_loader_lin_5.2.so"' >> /opt/php52/lib/php.ini
Zend_Optimizer Installation:
wget http://downloads.zend.com/optimizer/3.3.9/ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
tar -zxvf ZendOptimizer-3.3.9-linux-glibc23-x86_64.tar.gz
cp -rpf ZendOptimizer-3.3.9-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so /opt/php52/lib/php/extensions/no-debug-non-zts-20060613/
echo 'zend_extension="/opt/php52/lib/php/extensions/no-debug-non-zts-20060613/ZendOptimizer.so"' >> /opt/php52/lib/php.ini
Then, add extension directive for the below modules which are already compliled.
PDO
pdo_mysql
pdo_sqlite
SQLite
echo 'extension = "pdo.so"' >> /opt/php52/lib/php.ini
echo 'extension = "pdo_mysql.so"' >> /opt/php52/lib/php.ini
echo 'extension = "pdo_sqlite.so"' >> /opt/php52/lib/php.ini
echo 'extension = "sqlite.so"' >> /opt/php52/lib/php.ini
No comments:
Post a Comment