2

I previously setup my server by downloading php from php.net, and using the configure, make make install to get it onto my apache centos server.

Now I want to upgrade and I'm not sure how to do it.

If I do what is said here: http://www.webtatic.com/packages/php53/ It will attempt to upgrade php to 5.3.8. that's not an issue for me, but my concern is that it won't work because I have php 5.2.14 installed through the compile, rather than through YUM

What should I do - is there a way to save the current state of the server in order to reverse changes if it breaks?

Does anyone have any experience with this?

thanks

Jason

Ladadadada
  • 26,337
  • 7
  • 59
  • 90
Jason
  • 361
  • 7
  • 19

2 Answers2

2

If you want to switch to maintained packages, once you have been compiling from source it's safest to remove all of the files from your previous installation first. Note that some of these files may have been edited by yourself (such as php.ini) so you should take a backup of all of them first.

To do this, download the original source code (5.2.14) and compile and install it again but this time run your configure command with --prefix=/home/jason/build/ and create the build/ directory in your home. When you run make install, all of the files will be installed in the build directory. Running cd ~/build/; find . -type f > ~/php-5.2.14-file-list.txt will give you a list of all the files that you installed when you originally compiled PHP.

Once you have deleted all those files, check all the directories it installed ( cd ~/build/; find . -type d ) and for each of those, if it's empty you can remove it.

After that you should be safe to switch to RPMs without any fear of having two different version of PHP installed in different paths on your system.

Ladadadada
  • 26,337
  • 7
  • 59
  • 90
  • Great answer. To remove the gunk use this command: `mkdir /tmp/phpbuild3/; find -type f -exec mv /usr/local/{} /tmp/phpbuild3 \;`. My /usr/local/ dir was the original prefix on my build (check your phpinfo(); output for the ./configure cmd. You can just copy and paste that, run it with the new prefix and this method works a charm Thank you!! – Jason Apr 28 '12 at 09:24
0

It is not recommended to install the same package twice: one from source and one from yum. If you do so, you may end up having the package installed in two different locations (duplicated files). This may cause you troubles and confusion.

I suggest you try to upgrade by downloading the new source code and build it as you have done this before. Your system will not be changed unless you type make install.

Khaled
  • 36,533
  • 8
  • 72
  • 99