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
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

phpstorm-8

PHPStorm 8 has just been released

The excellent PHP IDE PHPStorm just had a major release these days: Version 8 is out, coming with latest PHP

Test GZIP compression of your server easily

If you are running servers (which you hopefully do), then Gzip compression should be a topic, as this simple thing

[Link] Redesigning SoundCloud by Evan Simoni

Again, an interesting approach / proof-of-concept on a redesign of a major website. Evan Simoni has overthought SoundCloud’s UI and

php-phalcon-logo

Which PHP-framework to learn in 2014 ? PHALCON, by far the fastest ever!

Hey guys, just a short little article between the years: If you have the possibility to learn and use a

bitdeli git github stats

php-login goes #2 PHP script worldwide in BitDeli stats

Holy! I just checked the stats of my little php-login hobby project on BitDeli (the tracking service for GitHub) and

phpstorm 7.0 php

How to setup and use XDEBUG with PHPStorm 6/7 (locally in Windows 7/8 and Mac OS X)

Real debugging is probably one of the most coolest things that are possible in software development: Remember the times where

Ghost

[FREE SERVER PROMO] Install GHOST for free on a free SSD server with this coupon

A little off-topic, but highly interesting: In April 2013 the former User Interface Head of WordPress (and WordPress expert) John

phpstorm 7.0 php

PHPStorm 7 has been released!

DEV METAL does not get any money for saying this and there is no affiliate link or similar. This post

css4

Angelina Fabbro talks about “CSS4” in this excellent conference video

A very interesting talk about the future of CSS – let’s name it “CSS4” as we talk about spec level

1/4

Categories

Search

phpstorm-8
Ignore .idea folder from git in PHPStorm
Frontend Ops Conf 2014 – Sarah Goff-Dupont: Git, Continuous Integration and Making It Pretty (31min video)
php
How to install latest PHP 5.4.x on Ubuntu 12.04 LTS (Precise Pangolin)
php
How to install PHP 7.0 on Ubuntu 14.04 LTS
composer
How to install Composer on Windows 7 / 8 or Ubuntu
github-logo-octocat
GitHub rolls out .PSD diff and viewing
digitalocean coupon
Free $10 coupon for DigitalOcean SSD cloud VPS hosting
php
PHP 5.7 gets refactored core, is 10%-30% faster than PHP 5.5! Wow!
composer
Composer problems ? Try full reset !
php
A super-simple introduction into PHP namespaces (7min video)
Increase your HTML / CSS coding speed with EMMET
php-phalcon-logo
Which PHP-framework to learn in 2014 ? PHALCON, by far the fastest ever!
O’Reilly’s Programming JavaScript Applications by Eric Elliott for free (Early Access release)
Hacking ATMs – A conference talk about the current security state of Windows XP driven cash machines
MINI, an extremely simple barebone PHP application

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