Server Fault is a question and answer site for system and network administrators. 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

I would like to update my php 5 in my server. At this moment, I use php 5.2.0 so I want to update it to php 5.2.4 (not php 5.3). I tried to do this:

aptitude update
aptitude upgrade

63 packets were updated but not php which is always in 5.0

How can I update my php please ?

Here is the output of commands asked by David in another post:

aptitude search php5
p   libapache-mod-php5              - server-side, HTML-embedded scripting langu
i A libapache2-mod-php5             - server-side, HTML-embedded scripting langu
i   php5                            - server-side, HTML-embedded scripting langu
p   php5-apache2-mod-bt             - PHP bindings for mod_bt
p   php5-auth-pam                   - A PHP5 extension for PAM authentication
i   php5-cgi                        - server-side, HTML-embedded scripting langu
p   php5-clamavlib                  - PHP ClamAV Lib - ClamAV Interface for PHP5
p   php5-cli                        - command-line interpreter for the php5 scri
i A php5-common                     - Common files for packages built from the p
i   php5-curl                       - CURL module for php5
p   php5-dev                        - Files for PHP5 module development
i A php5-gd                         - GD module for php5
p   php5-idn                        - PHP api for the IDNA library
p   php5-imagick                    - ImageMagick module for php5
p   php5-imap                       - IMAP module for php5
p   php5-interbase                  - interbase/firebird module for php5
p   php5-json                       - JSON serialiser for PHP5
p   php5-ldap                       - LDAP module for php5
p   php5-mapscript                  - module for php5-cgi to use mapserver
p   php5-maxdb                      - PHP extension to access MaxDB databases fo
i A php5-mcrypt                     - MCrypt module for php5
p   php5-memcache                   - memcache extension module for PHP5
p   php5-mhash                      - MHASH module for php5
p   php5-ming                       - Ming module for php5
i A php5-mysql                      - MySQL module for php5
p   php5-odbc                       - ODBC module for php5
p   php5-pgsql                      - PostgreSQL module for php5
p   php5-ps                         - ps module for PHP 5
p   php5-pspell                     - pspell module for php5
p   php5-radius                     - PECL radius module for PHP 5
p   php5-recode                     - recode module for php5
p   php5-snmp                       - SNMP module for php5
p   php5-sqlite                     - SQLite module for php5
p   php5-sqlite3                    - SQLite3 module for php5
p   php5-sqlrelay                   - SQL Relay PHP API
p   php5-suhosin                    - advanced protection module for php5
p   php5-sybase                     - Sybase / MS SQL Server module for php5
p   php5-tidy                       - tidy module for php5
p   php5-uuid                       - OSSP uuid module for php5
p   php5-xapian                     - Xapian search engine interface for PHP5
p   php5-xcache                     - Fast, stable PHP opcode cacher
p   php5-xmlrpc                     - XML-RPC module for php5
p   php5-xsl                        - XSL module for php5

aptitude show php5 | grep Version
Version : 5.2.0-8+etch13

aptitude show php5-cgi | grep Version
Version : 5.2.0-8+etch13

php5 --version
-bash: php5: command not found

php-cgi --version
PHP 5.2.0-8+etch13 (cgi-fcgi) (built: Oct  2 2008 08:21:17)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
share|improve this question

You are using Debian Etch, which comes with 5.2.0 by default. The issue isn't that trivial. Normaly the best way would be to download version from Lenny and compile, but in case of php5 it won't work that well, since theres a lot of dependencies and you would have to compile a lot of stuph.

Have you considered upgrading your distro to Lenny instead?

Your best shot is to find a external repo with precompiled php5 for Etch. Shot on Google points that might be a good start.

share|improve this answer
Debian Etch is no longer maintained by Debian – pauska Mar 12 '10 at 14:04
Yes, that's correct. Since 15th February there's no security updates whatsoever, so you should definitley reinstall / upgrade to lenny instead. – mdrozdziel Mar 18 '10 at 9:02

i also think upgrade to lenny is the best option.

but... if you insist and ready to do lots of work...

first of all.. backup! you might break your system if it fail. you could fall into dependencies hell etc...

  • add lenny repo
  • use apt pinning to upgrade only php
  • apt-get update && apt-get upgrade
  • if successfull, you might want to remove lenny repo to avoid future problem
  • if fail, restore your backup and start planning full distro upgrade to lenny

steps to upgrade your debian etch to lenny:

(most of the times, at least for me, upgrade is smooth and very little problems) to summarize the steps for standard debian (make sure you read above link) :

  • BACKUP! always have good backup.
  • make sure you have big free space
  • apt-get update && apt-get dist-upgrade
  • replace ALL 'etch' to 'lenny' in /etc/sources.list
  • apt-get clean
  • apt-get update
  • apt-get install apt aptitude
  • apt-get upgrade
  • apt-get dist-upgrade

that should be all you need. note: if you use other than standard repo, (depends on what's in the repo) you might need to disabled them first (especially, backports).

if it's critical system, try simulate the upgrade on virtual machine first.

share|improve this answer
Why not upgrade my distro but how to do this and, Is it realy secure ? I don't want to loose data, it's a prod server. – Kiva Mar 12 '10 at 16:41
edited my answer to include full distro upgrade – Mar 13 '10 at 11:34

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.