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
September 1, 2013
Chris
Debian, Linux, PHP
19

How to install/setup latest version of PHP 5.5 on Debian Wheezy 7.0/7.1/7.2 (and how to fix the GPG key error)

PreviousNext
php

Please note: This works fine. But this package will also upgrade your apache to version 2.4 which has different config files than apache 2.2 and even deletes stuff, like /etc/apache2/sites-available/default when upgrading. This may result in a loss of your apache settings (vhost, mod_rewrite stuff etc.). Be aware of that ! This shit cost me a full weekend. :(
This affects only upgrades, not fresh installs for sure.

Update on that issue: This is a known bug, I’ll keep this post updated…
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=716880

There’s a nice method to install the very latest version of PHP 5.5 on Debian Wheezy 7.0 or 7.1 with some bash commands.

 

1. Add these package sources to your sources.list file: Enter the file via

sudo nano /etc/apt/sources.list

and add these lines at the end of the file (right click pastes):

deb http://packages.dotdeb.org wheezy-php55 all
deb-src http://packages.dotdeb.org wheezy-php55 all

Save and close (CTRL-X, “y”, ENTER).

2. Do an update:

sudo apt-get update

You’ll get an error message in the last line of the update progress now.

3. It’s not possible to install PHP now, as Debian just gave an error and said that these new sources are not verified and blah blah, the public key is not available… I find this process highly unintutive and I really don’t know why it’s so complicated to update PHP, but well, that’s how it is…

Method #1
The last line of this error message contains a key, like “E9C74FEEA2098A6E”. Copy that key (mark the string with the mouse usually copies it into the clipboard) and run these commands to verifiy the new package sources (and put YOUR key in here):

gpg --keyserver packages.dotdeb.org --recv-key  E9C74FEEA2098A6E
gpg -a --export E9C74FEEA2098A6E | sudo apt-key add -

Method #2 (thanks Petr for bringing this in!)

wget http://www.dotdeb.org/dotdeb.gpg
sudo apt-key add dotdeb.gpg

4. Do an update again:

sudo apt-get update

5. Install the latest version of PHP 5:

sudo apt-get install php5

6. Check the installed version of PHP 5 (phpinfo() will still show old PHP version until apache restart):

php -v

Finally, restart the apache:

sudo service apache2 restart

By the way, it’s not possible (as far as I know) to install PHP 5.5 on Debian 6 (without compiling source code manually).

By the way #2, I’ve also written a tutorial on “How to setup latest version of PHP 5.5 on Ubuntu 12.04 LTS“, which is different from this here.

 

 

This article was written quite a while ago (9 years), please keep this in mind when using the information written here. Links, code and commands might be outdated or broken.

Random articles

  • [Link] Set up Nginx with PHP 5.5 easily[Link] Set up Nginx with PHP 5.5 easily
  • How to install/setup a basic LAMP stack (Linux, Apache, MySQL, PHP) on Ubuntu 12.04 or Debian 7.0/7.1How to install/setup a basic LAMP stack (Linux, Apache, MySQL, PHP) on Ubuntu 12.04 or Debian 7.0/7.1
  • How to install / setup PHP 5.5.x on Ubuntu 12.04 LTSHow to install / setup PHP 5.5.x on Ubuntu 12.04 LTS
  • PHPStorm: 42 Tips and Tricks (47min video talk by Mikhail Vink at Dutch PHP Conference 2015)PHPStorm: 42 Tips and Tricks (47min video talk by Mikhail Vink at Dutch PHP Conference 2015)
  • What’s new in PHPStorm 9What’s new in PHPStorm 9
  • Experimenting with HHVM at Etsy (Link)Experimenting with HHVM at Etsy (Link)
  • Dangerous Performance Myths in the Web (video talk by Thomas Lohner, PHPUG Latvia)Dangerous Performance Myths in the Web (video talk by Thomas Lohner, PHPUG Latvia)
  • Install MINI in 30 seconds inside Ubuntu 14.04 LTSInstall MINI in 30 seconds inside Ubuntu 14.04 LTS
  • MINI2, an extremely simple barebone PHP application on top of SlimMINI2, an extremely simple barebone PHP application on top of Slim
debianPHPPHP 5.5
Share this

19 Comments

  • Vladimir
    January 14, 2016 11:09 pm

    gpg: directory `/home/vagrant/.gnupg’ created

    gpg: new configuration file `/home/vagrant/.gnupg/gpg.conf’ created

    gpg: WARNING: options in `/home/vagrant/.gnupg/gpg.conf’ are not yet active during this run

    gpg: keyring `/home/vagrant/.gnupg/secring.gpg’ created

    gpg: keyring `/home/vagrant/.gnupg/pubring.gpg’ created

    gpg: requesting key A2098A6E from hkp server packages.dotdeb.org

    gpg: keyserver timed out

    gpg: keyserver receive failed: keyserver error

    Reply
  • Nick Niceman
    January 9, 2016 2:34 pm

    Dont forget enable php5 extension in apache, else you will see sources of your files – not a php .
    Nick

    Reply
  • entrepreneurIT
    September 25, 2015 10:22 am

    Thanks,was helpful

    Reply
  • Nico
    July 17, 2015 11:01 pm

    Dont try this on production… :S

    Reply
    • Chris
      July 18, 2015 12:51 pm

      Sure, nobody should change major versions of anything on production while being live + public!

      Reply
  • karol
    June 10, 2015 9:04 am

    How to undo this changes? My old Laravel 4.2 app not work (BladeCompiler error with preg_replace_callback(): Compilation failed: internal error: previously-checked referenced subpattern not found at offset 47)

    Reply
  • gryphes
    January 16, 2015 3:34 pm

    This article was all I needed, thank you very much!

    Reply
  • Danial Gordi
    December 29, 2014 6:38 am

    Nice , and worked for me.

    Reply
  • extremely_well
    December 15, 2014 7:39 am

    this package will also upgrade your apache to version 2.4

    After following the instructions, my Apache remained v2.2.22 even though PHP is now 5.5.19-1

    Is that ok?

    Reply
  • Paulo Silva
    July 13, 2014 1:37 pm

    I have followed this instructions to upgrade php 5.4 to 5.5 in Debian 7.5 and the Apache was not upgraded to 2.4 .

    It seems that Debian is not supporting yet Apache 2.4 in the stable version or i am wrong?

    Nice tutorial :)

    Reply
    • Chris
      July 14, 2014 4:37 pm

      This works perfectly. Btw, the tutorial is for 7.0/7.1, not 7.5

      Reply
  • Guest
    November 29, 2013 7:30 am

    atfer doing steps in your manual and apt-get upgrade following message:

    The following packages have been kept back:

    php-pear php5-cgi php5-cli php5-common php5-curl php5-dev php5-fpm php5-gd php5-intl php5-mcrypt php5-memcache php5-mysql php5-xmlrpc php5-xsl

    0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.

    Reply
  • Petr
    October 13, 2013 2:27 pm

    the “gpg” commands here did not work for me – there are different instructions (http://www.dotdeb.org/instructions/) on dotdeb.org website about adding their public repository key – those worked for me:

    wget http://www.dotdeb.org/dotdeb.gpg
    sudo apt-key add dotdeb.gpg

    Reply
    • Chris
      October 13, 2013 2:46 pm

      Hey Petr, that’s interesting, as I have “my” install instruction from exactly the same site. Anyway, thanks for the feedback, I’ll put this into the article.

      Reply

Leave A Comment Cancel reply

[Link] Making a website vertically responsive

Very useful tutorial by Ian Yates: How to make a website VERTICALLY responsive, adapting its content for small heights. Interesting

increase-your-pagespeed-score

Increase your PageSpeed score (10min video with Matt Gaunt)

Compact and clever information for dramatic speed increases. Definitly worth watching. This article was written quite a while ago (9

O’Reilly’s Programming JavaScript Applications by Eric Elliott for free (Early Access release)

O’Reilly currently offers the entire book Programming JavaScript Applications by Eric Elliott for free (as an online-readable version) while its

php

PHP.net hacked, but most things are fine again

Between 22nd and 24th October 2013 php.net served JavaScript malware (that was built to use security holes in the usually

“Fuck you. Pay Me.” How to deal with clients, the professional way. An excellent talk with Mike Monteiro.

Excellent (and very useful) speech by Mike Monteiro about how to deal with clients, how to create a professional relation

Stressed and unrelaxed while coding ? Try some ultra-deeply-relaxing ASMR audio clips. It will change your life. Seriously.

Do you remember your first professional massage – and that weird, extremely soft and relaxing feeling you had, this strange

php

Must-read PHP blog: PHPweekly.com

Probably one of the best ressources for your weekly doze of news from the PHP scene: phpweekly.com simply publishes a

node.js

PayPal drops Java, goes node.js / JavaScript

First: this is not a Java-vs.-AnyOtherLanguage diss, just an article about a very interesting development: Using “frontend-languages” for serious server-side

php mvc

Preview-release of (my) “php-mvc” project (a simple php mvc barebone)

Voila! The very first pre-final release of the “php-mvc” repository is online: https://github.com/panique/php-mvc and http://www.php-mvc.net. It’s a very simple but very

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

[Link] Making a website vertically responsive
How major web companies (and banks) handle passwords quite wrong
How to hack time (KUNG FURY promo campaign)
hiphop php
[Link] How to set up HipHop, Nginx and Laravel in Ubuntu 12.04 LTS (in a Vagrant box)
zend framework 3
First view on Zend Framework 3 by Matthew O’Phinney
vagrant
How to setup a (or multiple) server/LAMP-stack inside a virtual machine for local development with Vagrant and PuPHPet
ilovepreloaders – A tumblr collection of preloader animations
phpstorm 7.0 php
How to debug code on a remote server (or in vagrant box) with PHPStorm
phpstorm-8
A PHPStorm shortcuts cheat sheet (for Windows, Mac OS and Linux)
Frontend Ops Conf 2014 – Sarah Goff-Dupont: Git, Continuous Integration and Making It Pretty (31min video)
Quick fix for 404 error in WordPress category / tag page
php
Awesome list of Design Patterns with PHP code examples
atomic-design
An introduction into Atomic Design, a super-clean way to style web applications
php
[Link] Excellent PHP best practices, 2014 style
phpstorm-8
Killer-feature in PHPStorm: Search everywhere

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
 
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT