How to upgrade PHP4 to PHP5

Discussion in 'Server Operation' started by Jeroen, Jan 29, 2006.

  1. Jeroen

    Jeroen New Member

    Hi everybody,

    I followed the Debian Sarge Howto and everything went just fine. But now I want to update PHP4 to PHP5, how is this done?

    Thanks in advance,


  2. till

    till Super Moderator

    Debian sarge does not have PHP5 packages. You can find PHP5 packages for sarge on
  3. falko

    falko Super Moderator

  4. Jeroen

    Jeroen New Member

    Oke, but than what? How can I make apt-get to install packages from those sites?

    Thanks in advance,


  5. Jeroen

    Jeroen New Member

    Is this the correct syntax to update to php5:

    apt-get install libapache2-mod-php5 libapache2-mod-perl2 php5 php5-cli php5-common php5-curl php5-dev php5-domxml php5-gd php5-imap php5-ldap php5-mcal php5-mhash php5-mysql php5-odbc php5-pear php5-xslt curl libwww-perl imagemagick

  6. till

    till Super Moderator

    First you have to add the source from the site to your apt sources list. For add this line:

    deb sarge-backports main

    to your /etc/apt/sources.list. Then run the command:

    apt-get update

    To see which php5 packages are available, execute this command:

    apt-cache search php5

    Then install the packages that you need with the command:

    apt-get install packagename1 packagename2 pacakgename3

    The pcakaes might be named like this:

    apt-get install libapache2-mod-php5 libapache2-mod-perl2 php5 php5-cli php5-common php5-curl php5-dev php5-domxml php5-gd php5-imap php5-ldap php5-mcal php5-mhash php5-mysql php5-odbc php5-pear php5-xslt

    But I'am not sure if all these packages where available at, so its better if you compare this list with the packages list you get with "apt-cache search php5".
  7. avdongen

    avdongen New Member


    Quick question, after install PHP5 like Till explained do i need to change/do something with ISPconfig ? (like running the setup file again ??)


  8. falko

    falko Super Moderator

    No. You just need to restart your main Apache. :)
  9. oxxmoxx

    oxxmoxx New Member


    please let me add something to this topic, because I have to spend a lot of time to find a solution for a problem.

    After the update to php5 with apt-get and the parameters above apache and php5 works, but mysql and gd-support for example is per default not active.

    For activation the modules it is neccessary the modify the php.ini (/etc/php5/apache2/php.ini). In the Section "Dynamic Extensions" you have to integrate the modules - for example: "".

    Then restart the apache and everything works fine :)

    I hope this will help for some "isp-config fighter" to save time ...:rolleyes:

  10. pop_corn

    pop_corn New Member

    Hallo. I'm glad to see you've discussed something that I've been through for some time.
    I'm an Ubuntu 5.04 user and I installed php4 and mysql4 from my Synaptic. What I'm curious about is whether the things you've shared here are actual for my situation too. If not, I'm just wondering if you have some links or whatever useful to tell me what to do to get php5 version.

  11. falko

    falko Super Moderator

    I don't think this will work for Ubuntu. is for Debian only.
    But you can run
    apt-get update
    and search for PHP5 like this:
    apt-cache search php5
  12. pop_corn

    pop_corn New Member

    ^ I did it and there was no effect so I also did apt-get upgrade and then the update and searching commands. No php5 stuff found. I hope it's still impossible that php5 doesn't work on Ubuntu 5.04, huh.
  13. till

    till Super Moderator

    Please post the content of the file /etc/apt/sources.list
  14. pop_corn

    pop_corn New Member


    deb cdrom:[Ubuntu 5.04 _Hoary Hedgehog_ - Release i386 (20050407)]/ hoary main restricted

    deb-src hoary main restricted

    ## Major bug fix updates produced after the final release of the
    ## distribution.
    deb hoary-updates main restricted
    deb-src hoary-updates main restricted

    ## Uncomment the following two lines to add software from the 'universe'
    ## repository.
    ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    ## team, and may not be under a free licence. Please satisfy yourself as to
    ## your rights to use the software. Also, please note that software in
    ## universe WILL NOT receive any review or updates from the Ubuntu security
    ## team.
    deb hoary universe main restricted multiverse
    deb-src hoary universe

    deb hoary-security main restricted
    deb-src hoary-security main restricted

    deb hoary-security universe
    # deb-src hoary-security universe
  15. falko

    falko Super Moderator

    Then there are no PHP5 packages for Hoary Hedgehog. You could try to upgrade your system to a newer Ubuntu version like this:
    apt-get dist-upgrade
    But use this at your own risk! It's possible that your system becomes unusable...

Share This Page