Link to home
Start Free TrialLog in
Avatar of sitg
sitgFlag for Iceland

asked on

linux, RHEL, 4

Hi,
I want to upgrade the php 4 to php 5 on my rhel server, i just fresher in Linux, kindly help me deeply to this instaltion.
Regards,
Naresh
Avatar of andythedestroyer
andythedestroyer

It is pretty straight forward.

http://www.redhat.com/rhel/moving/

Just note that in 5 selinux is turned on by default and can cause problems if you are not used to working with it.

This is a useful webcast helping with selinux if you have trouble during the upgrade
http://www.redhat.com/v/swf/SELinux/
Avatar of sitg

ASKER

Hi,
I need to configure the php 5 on RHEL 4 for one of my imp client, kindly provide me the steps .
Naresh
Sorry, I didn't read carefully enough.

Well, if you just need a basic installation just yum it.

yum search php
yum install php.i386

The current version in a repositories is 5.1.6 and yum also has most of the standard extensions you need pdo, mysql etc.
Avatar of sitg

ASKER

thanks for reply sir, But I have not knowledge of basic command , can you give me the brife detail.
yum (yellowdog updater modified) is a package management tool for red hat based linux distros (RHEL, Fedora, Cent etc).

> yum search (program)
to search

then

> yum install (program)
to install

thats it. super easy. If you need more info on how to use yum read the man page.
> man yum
Avatar of sitg

ASKER

Sir
I try to install as per your instrucation, it give me the following error, Kindly help..

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
login as: root
root@192.168.1.200's password:
Last login: Fri Aug 10 21:23:30 2007 from 192.168.1.219
[root@rhel ~]# cd Desktop
[root@rhel Desktop]# ls
dump  php-4.4.7  php-4.4.7.tar.gz  yum-3.2.2  yum-3.2.2.tar.gz
[root@rhel Desktop]# cd yum-*
[root@rhel yum-3.2.2]# ls
AUTHORS      CVS      Makefile           rpmUtils      yum
bin          docs     output.py          shell.py      yumcommands.py
callback.py  etc      PLUGINS            test          yummain.py
ChangeLog    FAQ      po                 TODO          yum.spec
cli.py       i18n.py  progress_meter.py  translate.py  yum-updatesd.py
COPYING      INSTALL  README             utils.py
[root@rhel yum-3.2.2]# ./configure
-bash: ./configure: No such file or directory
[root@rhel yum-3.2.2]# make
for d in rpmUtils yum etc docs; do make PYTHON=python -C $d; [ $? = 0 ] || exit 1 ; done
make[1]: Entering directory `/root/Desktop/yum-3.2.2/rpmUtils'
echo "Nothing to do"
Nothing to do
make[1]: Leaving directory `/root/Desktop/yum-3.2.2/rpmUtils'
make[1]: Entering directory `/root/Desktop/yum-3.2.2/yum'
echo "Nothing to do"
Nothing to do
make[1]: Leaving directory `/root/Desktop/yum-3.2.2/yum'
make[1]: Entering directory `/root/Desktop/yum-3.2.2/etc'
echo "Nothing to do"
Nothing to do
make[1]: Leaving directory `/root/Desktop/yum-3.2.2/etc'
make[1]: Entering directory `/root/Desktop/yum-3.2.2/docs'
echo "Nothing to do"
Nothing to do
make[1]: Leaving directory `/root/Desktop/yum-3.2.2/docs'
[root@rhel yum-3.2.2]# make install
mkdir -p /usr/share/yum-cli
for p in callback.py cli.py i18n.py output.py progress_meter.py shell.py translate.py utils.py yumcommands.py yummain.py yum-updatesd.py ; do \
        install -m 644 $p /usr/share/yum-cli/$p; \
done
mv /usr/share/yum-cli/yum-updatesd.py /usr/share/yum-cli/yumupd.py
python -c "import compileall; compileall.compile_dir('/usr/share/yum-cli', 1, '', 1)"
Listing /usr/share/yum-cli ...
Compiling /usr/share/yum-cli/callback.py ...
Compiling /usr/share/yum-cli/cli.py ...
Compiling /usr/share/yum-cli/i18n.py ...
Compiling /usr/share/yum-cli/output.py ...
Compiling /usr/share/yum-cli/progress_meter.py ...
Compiling /usr/share/yum-cli/shell.py ...
Compiling /usr/share/yum-cli/translate.py ...
translate.py:117: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up
  if _StrToInt(buffer[:4]) != 0x950412de:
translate.py:162: FutureWarning: hex/oct constants > sys.maxint will return positive values in Python 2.4 and up
  f.write(_intToStr(0x950412de))    # magic number
Compiling /usr/share/yum-cli/utils.py ...
Compiling /usr/share/yum-cli/yumcommands.py ...
Compiling /usr/share/yum-cli/yummain.py ...
Compiling /usr/share/yum-cli/yumupd.py ...
  File "yumupd.py", line 213
    @dbus.service.signal('edu.duke.linux.yum')
    ^
SyntaxError: invalid syntax

mkdir -p /usr/bin /usr/sbin
install -m 755 bin/yum.py /usr/bin/yum
install -m 755 bin/yum-updatesd.py /usr/sbin/yum-updatesd
mkdir -p /var/cache/yum
for d in rpmUtils yum etc docs; do make PYTHON=python DESTDIR=`cd ; pwd` -C $d install; [ $? = 0 ] || exit 1; done
make[1]: Entering directory `/root/Desktop/yum-3.2.2/rpmUtils'
mkdir -p /root//usr/lib/python2.3/site-packages/rpmUtils
for p in arch.py __init__.py miscutils.py oldUtils.py transaction.py updates.py ; do \
        install -m 644 $p /root//usr/lib/python2.3/site-packages/rpmUtils/$p; \
done
python -c "import compileall; compileall.compile_dir('/root//usr/lib/python2.3/site-packages/rpmUtils', 1, '/usr/lib/python2.3/site-packages/rpmUtils', 1)"
Listing /root//usr/lib/python2.3/site-packages/rpmUtils ...
Compiling /root//usr/lib/python2.3/site-packages/rpmUtils/__init__.py ...
Compiling /root//usr/lib/python2.3/site-packages/rpmUtils/arch.py ...
Compiling /root//usr/lib/python2.3/site-packages/rpmUtils/miscutils.py ...
Compiling /root//usr/lib/python2.3/site-packages/rpmUtils/oldUtils.py ...
Compiling /root//usr/lib/python2.3/site-packages/rpmUtils/transaction.py ...
Compiling /root//usr/lib/python2.3/site-packages/rpmUtils/updates.py ...
make[1]: Leaving directory `/root/Desktop/yum-3.2.2/rpmUtils'
make[1]: Entering directory `/root/Desktop/yum-3.2.2/yum'
mkdir -p /root//usr/lib/python2.3/site-packages/yum
for p in comps.py config.py constants.py depsolve.py Errors.py failover.py __init__.py logginglevels.py mdparser.py misc.py packageSack.py packages.py parser.py pgpmsg.py plugins.py repoMDObject.py repos.py rpmsack.py sqlitecache.py sqlitesack.py sqlutils.py storagefactory.py transactioninfo.py update_md.py yumRepo.py ; do \
        install -m 644 $p /root//usr/lib/python2.3/site-packages/yum/$p; \
done
python -c "import compileall; compileall.compile_dir('/root//usr/lib/python2.3/site-packages/yum', 1, '/usr/lib/python2.3/site-packages/yum', 1)"
Listing /root//usr/lib/python2.3/site-packages/yum ...
Compiling /root//usr/lib/python2.3/site-packages/yum/Errors.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/__init__.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/comps.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/config.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/constants.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/depsolve.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/failover.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/logginglevels.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/mdparser.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/misc.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/packageSack.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/packages.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/parser.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/pgpmsg.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/plugins.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/repoMDObject.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/repos.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/rpmsack.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/sqlitecache.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/sqlitesack.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/sqlutils.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/storagefactory.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/transactioninfo.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/update_md.py ...
Compiling /root//usr/lib/python2.3/site-packages/yum/yumRepo.py ...
make[1]: Leaving directory `/root/Desktop/yum-3.2.2/yum'
make[1]: Entering directory `/root/Desktop/yum-3.2.2/etc'
mkdir -p /root/etc/yum/
mkdir -p /root/etc/yum/repos.d
install -m 644 yum.conf /root/etc/yum/yum.conf
mkdir -p /root/etc/logrotate.d
install -m 644 yum.logrotate /root/etc/logrotate.d/yum
mkdir -p /root/etc/rc.d/init.d
install -m 755 yum-updatesd.init /root/etc/rc.d/init.d/yum-updatesd
mkdir -p /root/etc/dbus-1/system.d/
install -m 755 yum-updatesd-dbus.conf /root/etc/dbus-1/system.d/yum-updatesd.conf
install -m 755 yum-updatesd.conf /root/etc/yum/yum-updatesd.conf
make[1]: Leaving directory `/root/Desktop/yum-3.2.2/etc'
make[1]: Entering directory `/root/Desktop/yum-3.2.2/docs'
mkdir -p /root/usr/share/man/man{5,8}
install -m 644 yum.8 /root/usr/share/man/man8/yum.8
install -m 644 yum-shell.8 /root/usr/share/man/man8/yum-shell.8
install -m 644 yum.conf.5 /root/usr/share/man/man5/yum.conf.5
install -m 644 yum-updatesd.8 /root/usr/share/man/man8/yum-updatesd.8
install -m 644 yum-updatesd.conf.5 /root/usr/share/man/man5/yum-updatesd.conf.5
make[1]: Leaving directory `/root/Desktop/yum-3.2.2/docs'
[root@rhel yum-3.2.2]# yum search php
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.3.4 (#1, Jan  9 2007, 16:40:18)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-3)]

If you cannot solve this problem yourself, please go to
the yum faq at:
  http://wiki.linux.duke.edu/YumFaq


[root@rhel yum-3.2.2]# yum install php.i386
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.3.4 (#1, Jan  9 2007, 16:40:18)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-3)]

If you cannot solve this problem yourself, please go to
the yum faq at:
  http://wiki.linux.duke.edu/YumFaq


[root@rhel yum-3.2.2]#
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Avatar of sitg

ASKER

I clear the following step, but not able to ope the default page.
kindly  help..
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


[root@rhel php-5.2.3]# make install
Installing PHP SAPI module:       cgi
Installing PHP CGI binary: /usr/local/bin/
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/man/man1/
Installing build environment:     /usr/local/lib/php/build/
Installing header files:          /usr/local/include/php/
Installing helper programs:       /usr/local/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/lib/php/
[PEAR] Console_Getopt - already installed: 1.2.2
[PEAR] Archive_Tar    - already installed: 1.3.2
[PEAR] Structures_Graph- already installed: 1.0.2
[PEAR] PEAR           - already installed: 1.5.4
Wrote PEAR system config file at: /www/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
Installing PDO headers:          /usr/local/include/php/ext/pdo/
+++++++++++++++++++++++++++++++++++++++++++++++++++
To upgrade  RHEL4 to RHEL5, get a set of RHEL5 CD's, boot from them on your server and go through the standard upgrade option during the installation.

I would also suggest looking at the upgrade log files in /root after the fact for warnings regarding the config files - some config files have changed the format from 4 to 5 and you will need to review them manually. The ones that come to my memory are vsftpd and xinetd configs, however, there are a few more.

Overall, the process is pretty straightforward.
ASKER CERTIFIED SOLUTION
Avatar of andythedestroyer
andythedestroyer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Arty K
sitg, hi.

I read your comment history, then searched google a little and found there is no easy way to install PHP5 on EL4 (because it have lots of newer dependencies): http://www.mehtanirav.com/2006/04/22/installing-php-on-rhel-4/ 
http://www.centos.org/modules/newbb/viewtopic.php?viewmode=flat&order=ASC&topic_id=1724&forum=28&move=prev&topic_time=1133346752

That's a working solution:

http://forum.ensim.com/showpost.php?s=993b26434a3a30083bf00bfd4e58db3a&p=68931&postcount=7

Run steps from 1 to 4, then edit your httpd.conf and check that correct module loads (from andythedestroyer post above). Anyway you should remove PHP4 before installing PHP5.

If it fails and you have enough time, I'll install RH EL4 locally and try to upgrade PHP4 myself.