Click to See Complete Forum and Search --> : [Resolved] Upgrading PHP on RH9


microbluechip
07-25-2004, 03:56 AM
Hi fellow PHPers,

I presume that RH9 comes with PHP 4.2.2 by default as there are no RPMS on the RedHat site to upgrade to a later version i.e. post 4.3.0+.

So my question is how to go about upgrading from 4.2.2 to say 4.3.8 in light of the security fixes and new functionality.

I am using Apache 2.0.40 so I believe (correct me if I'm wrong) I need to reference apxs2 with '--with-apxs2=/usr/sbin/apxs'

My current .configure syntax with 4.2.2 is huge :-

'./configure' '--host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu' '--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' '--with-apxs2=/usr/sbin/apxs'

Do I need to type all this into the shell to configure my new PHP or can I do this in sections i.e. do apache2 module first, then enable things like trackbvars, mysql, dbx, sockets etc in separate calls to configure, make, install.

What is the significance of --host=i386-redhat-linux' '--build=i386-redhat-linux' '--target=i386-redhat-linux-gnu'. My server has a P4 2.4 GHz CPU which is i686 (surely) so why is it referencing i386?? Curious!!

Many thanks to all for any support and guidance on this issue.

rachel2004
07-25-2004, 05:25 AM
I don't recognize all of the flags that you are enabling in your ./configure line, especially the first two or three.

However, yes, you can build PHP with only a few flags enabled at a time, BUT on each subsequent run of the "./configure, make, make install" follow the advice of the manual and run "rm config.cache" and additionally, "make clean". I have re-configured PHP many times and each time, I do a "rm config.cache" and then "make clean" and have not had problems. Run those two commands from the current PHP directory.

You will be able to find your older PHP RPM with:

rpm -qa | grep php | sort

and then remove it with:

rpm -e php_file_name_here

Afterwards, unless you have legacy code that will not function under v5.0, grab the tarball for PHP 5 and install it.

microbluechip
07-25-2004, 02:28 PM
Thanks for the info. Many thanks.

I have since re-read the documentation and it mentions using APXS2 - apache module loader or something. I do not seem to have this on my system even though I am using Apache 2.0.40. Does anyone know how I can get this. Is this the only way I can generate the libphp4.so module for use with Apache.

Sorry about the questions. I am more used to installing on Windows which is just a case of unzipping and copying a few files. lol.

tsinka
07-29-2004, 06:15 PM
Hi,

apxs is part of the apache2-devel package. Make sure that this package is installed.

Thomas