1

I'm following this guide: http://atik97.wordpress.com/2010/06/12/how-to-upgrade-to-php-5-3-in-ubuntu-9-10/

I've done all the steps, but it's still showing php 5.2.6 - any ideas?

I have also tried -cgi instead of -cli, neither have any effect.

update

I've tried rebooting the server to see if that would have any effect and unfortunately it didn't

update

Output of dpkg -l *php*:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                                          Version                                       Description
+++-=============================================-=============================================-==========================================================================================================
un  libapache2-mod-php4                           <none>                                        (no description available)
ii  libapache2-mod-php5                           5.2.6.dfsg.1-3ubuntu4.6                       server-side, HTML-embedded scripting language (Apache 2 module)
un  libapache2-mod-php5filter                     <none>                                        (no description available)
ii  php-pear                                      5.2.6.dfsg.1-3ubuntu4.6                       PEAR - PHP Extension and Application Repository
un  php4-cli                                      <none>                                        (no description available)
un  php4-dev                                      <none>                                        (no description available)
un  php4-mysql                                    <none>                                        (no description available)
un  php4-pear                                     <none>                                        (no description available)
ii  php5                                          5.2.6.dfsg.1-3ubuntu4.6                       server-side, HTML-embedded scripting language (metapackage)
ii  php5-cgi                                      5.2.6.dfsg.1-3ubuntu4.6                       server-side, HTML-embedded scripting language (CGI binary)
ii  php5-cli                                      5.2.6.dfsg.1-3ubuntu4.6                       command-line interpreter for the php5 scripting language
ii  php5-common                                   5.2.6.dfsg.1-3ubuntu4.6                       Common files for packages built from the php5 source
ii  php5-curl                                     5.2.6.dfsg.1-3ubuntu4.6                       CURL module for php5
un  php5-dev                                      <none>                                        (no description available)
ii  php5-gd                                       5.2.6.dfsg.1-3ubuntu4.6                       GD module for php5
ii  php5-imap                                     5.2.6-0ubuntu5.1                              IMAP module for php5
un  php5-json                                     <none>                                        (no description available)
ii  php5-mcrypt                                   5.2.6-0ubuntu2                                MCrypt module for php5
ii  php5-mysql                                    5.2.6.dfsg.1-3ubuntu4.6                       MySQL module for php5
un  php5-mysqli                                   <none>                                        (no description available)
ii  php5-xsl                                      5.2.6.dfsg.1-3ubuntu4.6                       XSL module for php5
un  phpapi-20060613+lfs                           <none>                                        (no description available)
ii  phpmyadmin                                    4:3.1.2-1ubuntu0.2                            MySQL web administration tool

update

The following commands and their outputs:

grep php53 /etc/apt/sources.list

deb http://php53.dotdeb.org stable all
deb-src http://php53.dotdeb.org stable all

apt-cache search -f "libapache2-mod-php5"

http://pastebin.com/XNXdsXYC

update I've updated the question with more details on installed packages.

6
  • 1
    How was php originally installed? Was it compiled from source? Where was it installed too? If you do "which php" what's the output?
    – AliGibbs
    Feb 15, 2011 at 15:04
  • I have no idea - is there a way for me to tell?
    – Ben
    Feb 15, 2011 at 18:32
  • Please add the output of dpkg -l *php* in your question.
    – Lekensteyn
    Feb 15, 2011 at 18:45
  • 1
    Can you do the following commands and post an update: grep php53 /etc/apt/sources.list and apt-cache search -f "libapache2-mod-php5" (please post the last output to link)
    – DrDol
    Feb 15, 2011 at 22:11
  • I've updated the question with the results of those commands
    – Ben
    Feb 17, 2011 at 15:57

6 Answers 6

3

I ran some experiments on a virtual machine running Ubuntu 9.10, these are the working instructions:

Remove all previously dotdeb installed lines into /etc/apt/sources.list and insert this line only

deb http://php53.dotdeb.org oldstable all

Then you should update package list using aptitude update, after this you should be able to select the php5.3 package, but if you do that you'll find that it's broken because of missing dependencies. To correct this you should install manually this two missing packages by using wget and dpkg by typing this:

wget http://us.archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu38_3.8-6ubuntu0.2_i386.deb
wget http://us.archive.ubuntu.com/ubuntu/pool/main/k/krb5/libkrb53_1.6.dfsg.4~beta1-5ubuntu2_i386.deb
sudo dpkg -i libicu38_3.8-6ubuntu0.2_i386.deb
sudo dpkg -i libkrb53_1.6.dfsg.4~beta1-5ubuntu2_i386.deb

Now add the dotdeb gpg key to apt keyring with curl http://www.dotdeb.org/dotdeb.gpg | sudo apt-key add - and then you will be able to select and install php5.3 with sudo apt-get install libapache2-mod-php. That's all, you have php 5.3.

3
  • When I try to update it says: ` The following packages have been kept back: libapache2-mod-php5 php-pear php5 php5-cgi php5-cli php5-common php5-curl php5-gd php5-imap php5-mcrypt php5-mysql php5-xsl`
    – Ben
    Feb 18, 2011 at 14:00
  • Ok, this is because of other packages, I tried with a clean Ubuntu with no php installed. In your case you should use aptitude to fix this situation. Do you know how to do that? Otherwise I'll edit my post ASAP with instruction to do that.
    – Fabio
    Feb 18, 2011 at 15:21
  • serverfault.com/questions/261611/… add the follwing links to source list
    – Roshan
    Aug 30, 2011 at 11:13
1

The guide only updates the -cli package, which is the binary used when you run PHP from the commandline. I'm guessing that the package doesn't conflict with other versions of the CGI and apache module.

You need to install either php5-cgi or libapache2-mod-php5, whichever you're using for the webserver.

1
  • It's not finding a new version of PHP5-CGI
    – Ben
    Feb 12, 2011 at 15:53
0

apt-get upgrade php5 and apt-get upgrade libapache2-mod-php5

Then restart apache

1
  • Neither of those did anything 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    – Ben
    Feb 12, 2011 at 15:58
0

With the dotdeb packages you should indeed be able to upgrade. The page you mentioned only upgrades, as posted, the CLI of PHP. Follow these instructions instead:

http://www.dotdeb.org/instructions/

And be sure to run sudo apt-get update before doing apt-get upgrade.

1
  • Plua - that's what we've done and apt-get upgrade doesn't find anything
    – Ben
    Feb 14, 2011 at 14:18
0

EDIT 2: You are correct in that none of this working! I just spun up a 9.10 VM and this does not work...i think something is wrong with the php53.dotdeb.org repositories...will get back to you shortly.

EDIT 3: I have for the life of me not been able to get PHP 5.3 installed on 9.10 using dotdeb repositories.

Is compiling from source an option? Is the machine in production use?

4
  • I've done all of that, the upgrade doesn't upgrade my php version when I do that.
    – Ben
    Feb 15, 2011 at 18:31
  • It is indeed in production use
    – Ben
    Feb 15, 2011 at 21:56
  • did you ever resolve this Webnet?
    – iainlbc
    Mar 4, 2011 at 17:17
  • Confirmed... There is something wrong with the repositories.
    – lepe
    Mar 8, 2011 at 7:19
0

In Ubuntu Lucid (10.04) you can do this:

Replace "lucid" for "maverick" in "/etc/apt/sources.list", and save it. Then open other terminal and execute aptitude, update sources and install/upgrade php5 files. This will update you to 5.3.3. Then undo ("maverick" to "lucid"), and save.

If you want 5.3.5 version, then use "natty" instead "maverick". I didn't have any package conflict, but I cannot warranty it would work perfect.

I hope it is useful.

I think Fabio's alternative is also good...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .