Forum Moderators: coopster

Message Too Old, No Replies

php5 upgrade

upgrade existing installation to php5

         

eflat

9:02 pm on Oct 2, 2007 (gmt 0)

10+ Year Member



I've been asked to upgrade an existing older linux/apache/mysql/php installation to php5. I'd rather not mess with the other components if I don't have to - just php5. Can I do that?

I can get around the command line ok, but haven't done alot of configuration. The install instructions at [php.net...] include steps on compiling apache -- do I really need to do that?

Thanks!

Frank_Rizzo

9:18 pm on Oct 2, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What flavour of Linux?

You may be able to do a yum update, apt-get and such.

eflat

9:27 pm on Oct 2, 2007 (gmt 0)

10+ Year Member



Red Hat Linux release 7.2 (Enigma)

I typed 'yum' and 'apt-get' at the command line, but got command not found for both?

eflat

4:30 pm on Oct 4, 2007 (gmt 0)

10+ Year Member



I could still use any tips on this...

eelixduppy

11:05 pm on Oct 4, 2007 (gmt 0)



You need to download the new version of PHP and replace all of the system files that go with php; basically reversing the process in the installation guide and then doing it again. It can really be a pain. If you installed php on your machine before, its the same thing but now you have to undo what you did before.

Frank_Rizzo

9:22 am on Oct 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A package manager like yum / up2date is the easiest option. See if you can install it if it is not there.

Another easy way is to install Webmin. Webmin is great for administrating linux servers. Install it if you can and then view / install / packages from the Software Packages section.

If you want to compile php5 manually here are the steps.

1. As root download, unzip and untar latest php5
2. change to php5 directory (php-5.2.4)
3. Create a batch file called phpconf.sh and paste


CPPFLAGS="-I/usr/local/include"
LDFLAGS="-L/usr/local/lib -lstdc++"
./configure --prefix=/usr \
--with-config-file-path="/etc" \
--with-apxs2="/usr/sbin/apxs" \
--enable-track-vars \
--enable-calendar \
--enable-magic-quotes \
--enable-trans-sid \
--enable-inline-optimization \
--enable-memory-limit \
--enable-soap \
--with-zlib \
--with-curl="/usr" \
--with-openssl="/usr" \
--enable-bcmath \
--with-gettext="/usr" \
--with-mysql \
--with-iconv \
--with-gd \

Now this is the bit where it could get tricky as you may need different configurations to the above - apache may be a different version / installed differently.

4. chmod 755 phpconf.sh
5. ./phpconf.sh
6. If no errors make
7. If no errors make install
8. You may need to edit your httpd.conf or php.conf file in the httpd/conf.d directory
9. Make a backup copy of your existing /etc/php.ini file. Copy the template php.ini file in the install directory to /etc/php.ini and edit as necessary.

[edited by: Frank_Rizzo at 9:26 am (utc) on Oct. 6, 2007]

SeanW

2:31 pm on Oct 6, 2007 (gmt 0)

10+ Year Member



Grab the source rpm package for a later version of RedHat/Fedora and rebuild it

rpm --rebuild php-5.1.#*$!x.src.rpm

That'll generate proper packages that are known to work with RedHat, which you can then upgrade.

You'll need the -devel rpms for the web server (httpd-devel or apache-devel, I don't remember that far back). The rebuild stage above will complain with what you ned.

I've used this technique on several older servers, though not that old :)

Sean

vincevincevince

2:38 pm on Oct 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To be honest you are working with a vastly out-of-date operating system. In your position I would tell the client that the operating system needs an upgrade to Fedora 7.