Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does anyone knows how do we force a php version to be installed when installing lamp via command line? For example I want to php5.1 when installing LAMP.

share|improve this question

I don't think it is possible to install PHP 5.1 from repositories.

The PHP5 Launchpad page lists supported PHP versions starting from Hardy. 5.2.4 is the first supported version.

You might be able to install from untrusted repositories or compile from source.

But please note you are taking risks by not using a supported PHP version. The real solution would be to upgrade/fix the application instead of downgrading.

share|improve this answer
+1, compile from source is the only option here. Its a really bad idea though.. most security patches in PHP aren't even tested against 5.1 anymore now that 5.2 is the "old version" and 5.3 is the current stable. 5.4 will be out very soon, so you are just slipping further behind. – SpamapS Nov 22 '11 at 19:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.