sudo apt-get upgrade also upgrade PHP from 5.2 to 5.3 on my Ubuntu 9.04?
upgrade will only install security updates. So the short answer is no.
The full answer is, that for 9.04 updates are no longer provided as it has reached the end of its life cycle last October. You should seriously consider updating to a newer release (using
sudo do-release-upgrade). Using 10.04 (which is an LTS release) you will get php 5.3.
Ubuntu 9.04 is now out of the update loop, so you're stuck with whatever you've got currently unless you update it manually.
To check the current version, you can:
- Check in Synaptic.
- Make a new PHP page containing:
<?php phpinfo() ?>, which tells you all about your current PHP configuration.
- Install the
apt-show-versionspackage, and then run
$ apt-show-versions php5.
If you don't have it and want to upgrade Jaunty (9.04) to PHP 5.3, I found a guide.
As a bit of background: The Ubuntu package update philosophy is usually to avoid major updates to packages; you'll receive only security patches, bugfixes and minor release updates. I'm not really familiar with the decision-making process, but I assume that PHP5 releases, being following the 5.x.y pattern, would remain on the 'x' that came with the distribution release. The 'y' would be updated, though.
Edit: Hit submit early, added more info.
If you want actual version of PHP (now it's 5.4), you should add ppa repository or build packages yourself.
5.4 is not for production now(wait until 5.4.1 or 5.4.2), it's for development.
sudo add-apt-repository ppa:ondrej/php5 sudo apt-get update sudo apt-get install php5 php5 -v