I'm working on a fresh CentOS server and am extremely annoyed to find out that yum does not work as smoothly and brilliantly as "apt-get install" does on Ubuntu.
Installing a LAMP stack, I ran the following:
$ yum install php
$ yum install mysql
Furthermore:
$ yum install mysql-server
$ yum install mysql-devel
$ yum install php-mysql
Now running:
$ rpm -qa | grep php
...shows that I have all kinds of php 5.1.6 packages installed and I need 5.2 minimum. In addition, I see that it installed mysql 5.0.77, even though the current release is 5.5.20. But hopefully mysql 5.0 will work. PHP 5.1 will not.
So the real question(s) is(are):
How do I fix my PHP to make it the latest stable release (5.3.9 according to PHP.net)? How do I make my CentOS machine work more like Ubuntu so I don't have to deal with this again?
Thanks very much.
EDIT: CentOS 5.7 was installed by a hosting company last week, so I don't know why they would have installed an older version of CentOS, rather than the most recent. I need PHP 3.2 at least, so I appreciate the suggestions on how to do that. I'm not very familiar with packages and repositories, but it appears that anyone can start a repository and so I'm concerned about installing things from some random repository that could infect the server.
CentOS is a DERIVATIVE of the very conservative Red Hat Enterprise Linux, so package updates will generally be delayed even further than RHEL. Packages in either distribution are going to be a little older.
If you're running CentOS 5, you ought to try CentOS 6 to see if it suits your needs.
If you need something a little more cutting-edge than CentOS 6, you should look into Fedora.
Follow-up: CentOS has been brought "in-house", and is more tightly integrated. Newer CentOS releases will see the benefits of a tighter release cycle, but for older releases this answer will still hold true.
They're not outdated; they're the latest that CentOS 5 has in its repositories.
Red Hat (and Ubuntu for that matter) never, ever publish a new major version of software into their package repositories for a given OS version, for the sake of stability - you don't want to run an upgrade and suddenly have your config not work.
Instead, they backport security fixes and important bugfixes into the version of the software that was 'stable' when the OS was released, avoiding the introduction of new features (and their bugs).
Since you're on CentOS 5, the official repositories have some fairly old versions of stuff. But fear not - you can probably easily find a third party repository with the versions of software that you need.
Or, why not upgrade to 6?
I'd say uninstall CentOS and install Ubuntu, if that's what you want to use. But it must be an older version of CentOS you use. CentOS 6.2 uses PHP 5.3 and MySQL 5.1.
You can use Remi repository to get newer versions of Apache/PHP/MySQL
And you don't make your CentOS machine work more like Ubuntu, because it is not Ubuntu. It's like saying "How do I make my Chrysler drive more like a Ford".
Updated response:
I got some down votes on this, so I think my intentions has been misunderstood, let me try to correct that.
I have set up a VPS in our environment and installed the packages, so I should be where you are at right now:
In my first response, I assumed you wanted the latest releases, then you should use the Remi repository as I have stated above. However, if the PHP 5.3 version within centOS is fine (5.3.3) then read on.
When trying to install php53 it complains that there is a conflict, since this package will cover the same things as the PHP 5.1 package. To solve this you need to remove all PHP related packages to begin with:
Next thing you do is to install the equivalent packages with php53:
So, PHP was quite easy. But MySQL is another story, since MySQL 5.0 is the only MySQL in the default CentOS repositories. I run the 64 bit version of CentOS, if you do not you need adjust the following to fit 32 bit instead.
There are several ways of doing this but I'm gonna go with the Remi repository. It's been around for years and maintaining is easier with a repo than using plain RPM files.
Remi requires the EPEL repository so start by installing that:
Next, you install the Remi repo RPM
Next you remove the current MySQL server (otherwise you will get conflicts when trying to install the new one).. NOTE! If you have databases on there, make a backup before doing this!
Then you can go on and install the MySQL from the Remi repository:
Now when you try to start MySQL it may fail because the old mysql left some things behind, and this can be kind of painful to get rid of. In my case here I needed to remove some things to get it working. These did it for me: