Logo
  • PHP
    • HipHop / HHVM
    • Modern PHP
    • PHPStorm
    • LAMP
    • Laravel
    • Composer
    • PDO
  • JavaScript
    • node.js
    • AngularJS
  • CSS
    • SASS
    • “CSS4” (CSS level 4)
  • HTML
  • Git
  • LAMP
  • Vagrant
  • UI / UX
  • Architecture of …
  • Off-Topic
With ♥ from Berlin
November 4, 2013
Chris
PHP, Ubuntu
Comments Off on How to install latest PHP 5.4.x on Ubuntu 12.04 LTS (Precise Pangolin)

How to install latest PHP 5.4.x on Ubuntu 12.04 LTS (Precise Pangolin)

PreviousNext
php

Disclaimer: Currently 5.5 is the very latest version of PHP, but the common way to install PHP 5.5 has a major disadvantage: It will also install Apache 2.4 or update your Apache 2.2 (standard!) to version 2.4, which will introduce new apache config files, removing current ones (!). No joke. As many apache tutorials teach people to change stuff in /etc/apache2/sites-available/default (which will be removed during Apache 2.4 installation) it might be a bad choice to install PHP 5.5. If you still want to install PHP 5.5, check these articles:

How to install/setup latest version of PHP 5.5 on Debian Wheezy 7.0/7.1/7.2
How to install/setup latest version of PHP 5.5 on Ubuntu 12.04 LTS (Precise Pangolin)

 

And now, let’s install the latest version of PHP 5.4

There’s an excellent and (usually) hassle-free method to install the latest version of PHP 5.4 with 3 simple bash commands:

1. Add this package-repository to your system. If Ubuntu says that you need to download a key first, then follow the instructions given in the notice.

sudo add-apt-repository ppa:ondrej/php5-oldstable

If you get an error message now, then please do an update first and install the python-software-properties, that need to be necessary to add a package repository:

sudo apt-get update
sudo apt-get install python-software-properties

2. Update

sudo apt-get update

Check the available version of PHP (the result is self-explaining, the version on the top is the one that will be installed):

apt-cache policy php5

3. Install PHP 5.4.x

sudo apt-get install php5

Check the installed version of PHP (if this does not show 5.4.x please restart your apache)

php5 -v

Please note: The ondrej/php5-oldstable repository (which is used here) provides the very latest version of the PHP 5.4-branch. Usually a version-update is available a few days after it was been officially released. This is really cool and a big step forward as Ubuntu, Debian, CentOS etc. provide only very old versions by default.
 
[wp_ad_camp_2]
 

To UPDATE from PHP 5.3 to 5.4:

It’s also possible to update from any PHP version to 5.4 one with exactly the commands above. But, after doing

sudo apt-get install php5

you’ll have to restart the server with

sudo /etc/init.d/apache2 restart

or

sudo service apache2 restart

 

PHPphp 5.4Ubuntu
Share this
hack-php

Facebook releases HipHop (HHVM) 3.0, adds mysqli and support for Hack language

Lots of movement in the PHP world these days! After releasing Hack (a dramatically improved fork of the entire PHP

shadow dom

Crossbrowser-safe HTML5 video (IE6+) with a few lines of code and just one .mp4 video file

No time to read the full article ? Get the code directly here on GitHub: panique/html5-video. Publishing a video on

js javascript

Push database changes to all clients in real-time (!) with AngularJS and Firebase

The coolest talk I’ve seen this week: Anant Narayanan of Firebase shows how to build a simple but really impressive

composer

How to install Composer on Windows 7 / 8 or Ubuntu

Installation on Windows 7 / 8 Installing Composer on Windows 7 or 8 is extremely easy: Get the latest version

sass laravel

SASSmeister is a real-time JSfiddle for SASS / CSS. Awesome!

Excellent tool for testing out SASS in real-time! SASSmeister.com offers a responsive (!) interface for quick SASS-to-CSS development with some

html6

Is this the first HTML6 specification?

  I just found this very interesting “project” including an active, but unpopular GitHub repo: http://html6spec.com/ https://github.com/OscarGodson/HTML6 Looks like these

css

How to center a div vertically and horizontally (modern methods, without fixed size!)

“How to center a div” (inside another div or inside the body itself) is one of the most discussed questions

logo-internet-explorer

How to professionally test on old Internet Explorer versions

If you have (or want) to test your websites and applications on older versions of Internet Explorer, then there’s a

phpstorm-8

PHPStorm 8 (early access version) released – for free

JetBrains have just released an Early Access version of the upcoming PHPStorm 8. In case you never worked with PHPStorm

Awesome next-gen PS4 graphics in “The Order: 1886”

We are entering a very interesting time: The differences between cinematic movies and video games are getting lesser and lesser.

1/4

Categories

Search

Serious hard-to-fix bug in OAuth and OpenID discovered, lots of major sites affected
php ide
Sitepoint asks for your favourite PHP IDE – take part!
All new features of WordPress 3.9 in this 2 minute video
phpstorm-8
Ignore .idea folder from git in PHPStorm
modern-php
Creator of Slim framework and “PHP – The right way” writes book: “Modern PHP”, available 2015
How Instagram.com works
First look on Gitter, the chat for GitHub
twig
A 6min video introduction into Twig, the PHP templating engine
mod-rewrite-ubuntu-14-04-lts
EOL lists of Ubuntu, Debian and CentOS for your server plannings
october cms
October CMS, built on top of Laravel, is beautiful, clever and on the way to be the new #1 CMS
MINI, an extremely simple barebone PHP application
Rare Steve Jobs AND Bill Gates video interview from 2007’s D5 conference (90min)
unreal-4-engine
Tim Sweeney talks about the future of game graphics (and which hardware we need to “clone” reality)
css3-chrome-font
[Link] Retinafy your Site / Device by Nijiko Yonskai
Awesome next-gen PS4 graphics in “The Order: 1886”

Tags

apache bash centos composer conference coupon CSS debian fonts framework git GitHub hack HHVM HipHop HTML HTML5 IDE JavaScript JS LAMP laravel linux mod_rewrite MVC MySQL Nginx optimization PHP PHP 5.5 PHP 5.6 phpmyadmin PHPStorm security server SSD Ubuntu UI UX vagrant video virtual machine voucher VPS wordpress
Side-Project: Wordle-Solver:
www.wordle-helper.info

Pages

  • Privacy Policy