LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2005, 04:16 AM   #1
notooth
Member
 
Registered: Apr 2005
Posts: 192

Rep: Reputation: 15
How to Upgrade PHP on RH Linux 9 ?


Hello everyone,

I am running RH Linux 9 with PHP 4.2.2, but I want to upgrade PHP to 5.1.1 or 4.4.1 for my need. Can anyone guide me to do this. I have tried to upgrade PHP to 5.1.1 (from source) with no success.

Please help.
 
Old 12-02-2005, 03:21 PM   #2
nukeu666
Member
 
Registered: Mar 2004
Location: India
Distribution: MDK, Fedora, Debian Unstable (current)
Posts: 80

Rep: Reputation: 15
post the error u got while installing from source
its also not a good idea to try to overwrite php4 with php5
install it in another folder...then configure apache(web server) to use php5 instead
 
Old 12-03-2005, 04:22 AM   #3
notooth
Member
 
Registered: Apr 2005
Posts: 192

Original Poster
Rep: Reputation: 15
Code:
[root@me php-5.1.1]#
[root@me php-5.1.1]# './configure' '--host=i686-pc-linux-gnu' '--build=i686-pc-linux-gnu' '--target=i386-redhat-linux' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-force-cgi-redirect'
loading cache ../config.cache
checking for Cygwin environment... no
checking for mingw32 environment... no
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking host system type... i686-pc-linux-gnu
checking target system type... i386-redhat-linux-gnu
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking whether gcc and cc understand -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for AIX... no
checking whether ln -s works... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for re2c... no
configure: warning: You will need re2c 0.98 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for bison... no
checking for byacc... no
checking for bison version... invalid
configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 (found: none).
checking for flex... lex
checking for yywrap in -ll... no
checking lex output file root... ./configure: line 3238: lex: command not found
configure: error: cannot find output from lex; giving up
[root@me php-5.1.1]# make
make: *** No targets specified and no makefile found.  Stop.
[root@me php-5.1.1]#
 
Old 12-04-2005, 03:46 AM   #4
nukeu666
Member
 
Registered: Mar 2004
Location: India
Distribution: MDK, Fedora, Debian Unstable (current)
Posts: 80

Rep: Reputation: 15
u dont have a lexical analyser installed
download and install flex (or any other lex package)
 
Old 12-04-2005, 07:13 AM   #5
notooth
Member
 
Registered: Apr 2005
Posts: 192

Original Poster
Rep: Reputation: 15
After installing flex, I got a new error:
Code:
Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
[root@chuong php-5.1.1]#
I have installed libxml2-2.5.4-1.i386, but it didn't solve the problem.
 
Old 12-04-2005, 11:15 AM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
You'll need the development package, libxml2-devel, which contains the programming headers and other things needed to build software using the libraries. IIRC you'll have to upgrade Apache too, since recent versions of PHP require a newer Apache than the one shipped with RH9 to work.
 
Old 12-04-2005, 03:04 PM   #7
notooth
Member
 
Registered: Apr 2005
Posts: 192

Original Poster
Rep: Reputation: 15
Why do I need to install so many packages?
The ./configure command I used was generated by "php -i | grep configure."
Doesn't it mean that all packages in ./configure command were already installed and used to make previous PHP?
 
Old 12-04-2005, 04:12 PM   #8
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
The development package is only needed to build the software, not to run it. It was installed on whatever system Red Hat built the package on, but is not on your system apparently.
 
Old 12-04-2005, 04:25 PM   #9
notooth
Member
 
Registered: Apr 2005
Posts: 192

Original Poster
Rep: Reputation: 15
Does it mean that if I have another RedHat system with all packages, I can use it to install PHP on this Linux 9?
 
Old 12-05-2005, 02:49 AM   #10
nukeu666
Member
 
Registered: Mar 2004
Location: India
Distribution: MDK, Fedora, Debian Unstable (current)
Posts: 80

Rep: Reputation: 15
the packages have to be installed...having it on another comp wont matter
./configure checks if u have all the packages that the program needs
if u can...try to install rh9 again, this time ticking all the programming tools and devel tools also during install
or even better...use a newer version instaead of rh9
 
Old 12-05-2005, 06:33 AM   #11
notooth
Member
 
Registered: Apr 2005
Posts: 192

Original Poster
Rep: Reputation: 15
I couldn't reinstall Linux because there are some websites running on this machine. I don't want to break it.
Anyway, I think I just need the packages already installed on the machine, and I should remove unnecessaries declared in ./configure command.
I am wondering if it is a good idea.

At this time, ./configure command asks me to install BZip2, but I don't think I would need it because the machine is running only for web server.
Should I remove it from ./configure command?
 
Old 12-05-2005, 06:33 AM   #12
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Why not just get Fedora Core 4 instead of using RH9?
 
Old 12-06-2005, 03:33 PM   #13
notooth
Member
 
Registered: Apr 2005
Posts: 192

Original Poster
Rep: Reputation: 15
I have successfully upgraded to PHP 4.4.1, but after rebooting the system, I still see PHP 4.2.2 in phpinfo().
This is a virtual dedicated server I rented from a web host. Maybe it is not allowed to upgrade PHP.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Upgrade z_darius Mandriva 3 03-29-2005 07:10 AM
Upgrade PHP objorkum Slackware 5 03-25-2005 01:14 PM
upgrade PHP Mark007 Slackware 1 02-03-2005 07:29 AM
upgrade php from 4.3.2 to 5 pelegk2 Linux - Software 1 10-10-2004 09:37 AM
Upgrade php 4.2.x to 4.3.x buzzbuzz Linux - Newbie 0 10-30-2003 10:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration