LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Please help me upgrade PHP from 4.2.2 to 5.1.6 (https://www.linuxquestions.org/questions/linux-software-2/please-help-me-upgrade-php-from-4-2-2-to-5-1-6-a-482823/)

trewsfan 09-12-2006 02:11 PM

Please help me upgrade PHP from 4.2.2 to 5.1.6
 
Hey Everybody,

I need some advice on upgrading my database server. The current version of PHP I'm using is 4.2.2 because that's what came with the install disks, but there's some XML functions in PHP 5 that I want to use.

The server is made of PostgreSQL, PHP and Apache, and here's the details about package versions:

Hardware:
Intel Celeron 1.70 GHz
512 MB Ram

Software:
[root@krakatoa httpd]# cat /proc/version
Linux version 2.4.20-9 (bhcompile@stripples.devel.redhat.com) (gcc version 3.2.2 20030313 (Red Hat Linux 3.2.2-10)) #1 Wed Apr 2 13:42:50 EST 2000

[root@krakatoa httpd]# rpm -qa | grep sql
postgresql-libs-7.3.2-3
postgresql-devel-7.3.2-3
mysql-server-3.23.56-1.9
php-mysql-4.2.2-17
mod_auth_pgsql-0.9.12-14
postgresql-tcl-7.3.2-3
libdbi-dbd-mysql-0.6.5-5
postgresql-docs-7.3.2-3
libdbi-dbd-pgsql-0.6.5-5
postgresql-7.3.2-3
postgresql-python-7.3.2-3
postgresql-pl-7.3.2-3
mysql-3.23.56-1.9
php-pgsql-4.2.2-17
postgresql-odbc-7.2.5-1
postgresql-server-7.3.2-3
mysql-devel-3.23.56-1.9
postgresql72-libs-1-3
mod_auth_mysql-1.11-12
postgresql-jdbc-7.3.2-3
postgresql-contrib-7.3.2-3
postgresql-test-7.3.2-3

[root@krakatoa httpd]# rpm -qa | grep httpd
redhat-config-httpd-1.0.1-18
httpd-2.0.40-21.1
httpd-manual-2.0.40-21.1
httpd-devel-2.0.40-21.1

[root@krakatoa httpd]# rpm -qa | grep php
php-ldap-4.2.2-17
php-mysql-4.2.2-17
php-4.2.2-17
asp2php-gtk-0.76.2-5
php-manual-4.2.2-17
asp2php-0.76.2-5
php-devel-4.2.2-17
php-pgsql-4.2.2-17
php-odbc-4.2.2-17
php-snmp-4.2.2-17
php-imap-4.2.2-17


I'm not sure how to upgrade to PHP 5 or better, I'm thinking of doing something like this:

1. Download the newest PHP 5.1.6 source
2. Unpack it, configure, make, make install
3. Change my httpd.conf file from "LoadModule php4_module modules/libphp4.so" to "LoadModule php5_module modules/libphp5.so"

If I did this, I'd expect to have both PHP 4.2.2 and PHP 5.1.6 on my server. Then if the PHP 5 causes some unexpected problems with my existing code, I could go back to using the PHP 4.2.2 by editing the httpd.conf file to load the libphp4.so module instead. But, is it a bad idea to have both PHP 4.2.2 and PHP 5.1.6 on the same machine?

Has anyone done something like this and can give some advice?

Thanks.

leandean 09-13-2006 01:01 AM

Start here:

http://www.php.net/manual/en/faq.migration5.php


All times are GMT -5. The time now is 07:26 AM.