How do I install latest PHP in supported Ubuntu versions (like 5.4.x in Ubuntu 12.04)?
-
I am trying to update to php 5.4 in Ubuntu 12.04, and I can only get 5.3.6 using official repositories (using apt-get). I'm not really sure how to do a manual update – I'm sorta new to ubuntu, but I need to play around with the new php features!
-
Answer:
You could use a PPA to stay up-to-date with PHP. I use: https://launchpad.net/~ondrej/+archive/php5 It's now on 5.5 and also includes Apache 2.4 update. For Apache 2.2+ PHP 5.4 repository, see the bottom of the answer. If you want use this PHP, do this: https://launchpad.net/~ondrej/+archive/php5 (http://askubuntu.com/q/4983) sudo add-apt-repository ppa:ondrej/php5 sudo apt-get update sudo apt-get upgrade sudo apt-get install php5 If you don't have add-apt-repository binary do the following: sudo apt-get install python-software-properties Precautions: http://askubuntu.com/questions/35629/are-ppas-safe-to-add-to-my-system-and-what-are-some-red-flags-to-watch-out For Ubuntu 12.10 Ubuntu 12.10's official repository http://packages.ubuntu.com/quantal/php5 to PHP 5.4. You should use the main repository package if you can. To do this, just install https://apps.ubuntu.com/cat/applications/php5 without enabling any PPA. PHP 5.4 Prepackaged latest PHP 5.4 now resides in separate PPA: https://launchpad.net/~ondrej/+archive/php5-oldstable
kavisiegel at Ask Ubuntu Visit the source
Other answers
It will take some time for PHP 5.4 packages to make their way into Ubuntu, as there are an awful lot of dependency checks to do. Ubuntu 12.04 is now in beta so I doubt they'll upgrade it to PHP 5.4 (although I have no official or inside knowledge of this) -- it probably won't appear until Ubuntu 12.10 in October this year. If you want it sooner than that, you'll either have to find a third-party package or learn to build it yourself from the source code.
Mike Scott
Here's what I understand that you have to do (Type these commands in the terminal): curl http://apt.damz.org/key.gpg | sudo apt-key add - Someone asked about PPAs and Ubuntu ( http://askubuntu.com/questions/4983/what-are-ppas-and-how-do-i-use-them ), and they share how to add a repository line. Here's the repository line you need: deb http://apt.damz.org/ubuntu natty php54 After all of this, just do the following two commands and you should be all set! sudo apt-get update sudo apt-get install php5 libapache2-mod-php5
willbeeler
Related Q & A:
- How can I debug my php code?Best solution by Stack Overflow
- How can I copy file from Windows to Ubuntu?Best solution by Super User
- How can I install node.js module using phantom, instead of npm?Best solution by Stack Overflow
- How do I install a dell 920 without an install CD?Best solution by Yahoo! Answers
- How do I install flash player on ubuntu 9.10?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.