I am experienced in PHP, but I have never installed it. We have just upgraded onto a VPS from 1and1 and now we need to upgrade php ourselves apparently. We want to go from 5.1.4 to the latest, but don't know where to start. I looked here
http://www.php.net/manual/en/install.unix.apache2.php
But I can't find the apxs path.
I was hoping to find someone who had experience of doing this on 1and1 vps, but failing that here is the link that shows my phpinfo, http://spotblue.co.uk/phpinfo.php
I was hoping you may be able to direct me from that. I am willing to answer as many questions to get this clear, as I know the first time will be the hardest.
Upgrading PHP should simply be a matter of using your Linux's package manager.
If it's Debian (or Ubuntu), then apt-get, if it's CentOS then yum, etc.
PHP 5.1 is pretty old, what Linux distribution did you get on your VPS?
Edit: Ah, I see from your phpinfo it's CentOS. Probably CentOS 5? The versions of code on CentOS 5 are pretty far behind. You either need to find an more up-to-date repository (see MadHatter's response), or download all the source files yourself and build new versions. If you're asking this question, I suggest you don't try building from source.
It's a long time since I had to go looking for newer versions of stuff on CentOS so I'll let someone else answer. The other option is move to CentOS 6 if 1and1 will let you (probably still back level, but better than 5).
I'm not trying to replace EightBitTony's answer, because it's excellent, but if you decide you want to push ahead with getting a later PHP on Centos 5, you do have some options.
There are a set of packages in the regular updates repository called
php53*
. If you would prefer them, uninstall your current PHP packages (yum remove php php-cli php-xml php-common...
), and install the corresponding php53 packages (yum install php53 php53-cli php53-xml php53-common...
).You may wish to check that there are corresponding 5.3 packages for everything you're currently running before doing the above.