LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   Installing newer version of php (apt-get) (http://www.linuxquestions.org/questions/debian-26/installing-newer-version-of-php-apt-get-154223/)

waffe 03-06-2004 11:29 AM

Installing newer version of php (apt-get)
 
Hi

I currently have php 4.1.2 installed on my Debian 3 Linux box. I would like to upgrade to the latest version, which is 4.3.4. I have tried using, "apt-get install php4" but it says I already have php4 installed. I then ran "apt-get update" and "apt-get upgrade", and then run apt-get install php4 again to get the same message. Last I tried "apt-get remove php4" and then "apt-get install php4" only to see the same php 4.1.2 was installed again.

How do I install the latest and greatest version of php?

Thanks

Qzukk 03-06-2004 12:00 PM

Rather than thinking of debian in terms of version numbers, you need to start thinking in terms of release stages. Don't think "Debian 3", think "Debian Stable". The "Stable" (aka Woody) means that every package you have access to has undergone significant testing, and installing any given package will almost never break your system.

Pro: You can automate upgrades and get the latest security fixes without worrying that something will break.
Con: It will take months from now before php 4.3.x will appear in Stable, if it does at all (enough changes have been made that might break existing .php code... you see where this is going, right?)

So, what is there to do? You'll have to get php from a higher stage. "Testing" (aka Sarge) is the next step up. According to http://packages.debian.org/testing/web/ php4 is at 4.3.3

Pro: Newer packages than Stable
Con: *no security fixes*

If not having up-to-date security fixes scares you (and it should), you can upgrade to SID instead. SID stands for "Still In Development" and consists of the newest packages in Debian. This is the "Unstable" branch. Here, we have php4 4.3.4

Pro: Newest packages possible. This includes security fixes
Con: Newest packages are often untested and can break, sometimes seriously.

Still want to upgrade? Edit /etc/apt/sources list and replace your deb line with
deb http://http.us.debian.org/debian xxxxx main contrib non-free
where xxxxx is stable testing or unstable. (and .us. is your country code, in case you don't live here.) apt-get update; apt-get dist-upgrade

Don't want to upgrade? You have two choices. 1) Search http://www.apt-get.org for a "backport" of the php4 package you want and follow their instructions for installing it. 2) Backport the package you want yourself. The easy way is to follow these steps:
1)Choose which stage you want to backport from (probably unstable) and create the line in /etc/apt/sources.list (comment out any existing deb-src lines).
deb-src http://http.us.debian.org/debian xxxxxxx main contrib non-free
2) Install all compilation tools you'll need (the meta-package "build-essential" will automatically install these)
3) run apt-get source --compile php4 This will download and attempt to compile php4 into packages. If it says you need yyyyy:
a) try apt-get install yyyyy. If it works and you can get the right version for the php package, try compiling php4 again.
b) if it doesn't work, apt-get source --compile yyyyy.
---- Repeat the above steps until you can get everything you need compiled and installed (the --compile step will create .deb files you install using dpkg -i filename.deb)

The hard way (which is what is used to get on apt-get.org) is to pick apart the configuration for the newer package to see what will and wont work on the stable system. Disable features where the libraries are not available, change the configuration to require lower version numbers, etc.

In your case, apt-get.org lists several php4 backported packages. This is the way I suggest you go.

llamakc 03-06-2004 12:23 PM

Qzukk,

That's a wonderfully-written reply. You should consider writing some stuff for the Debian WIKI here at LQ.

Good job,

Ken

waffe 03-06-2004 12:32 PM

Thanks Qzukk,

So when I see the word (woody) next to Debian it means it is the stable version of debian. Got it.

I don't think this is where my web server problem lies. Since this is the latest stable version of php I doubt upgrading will solve my php problem.

Thanks.

Qzukk 03-06-2004 02:58 PM

Well, its not the latest stable version of php. Being in Debian Woody just means that it was the stable and tested version that was available at the time.

waffe 03-06-2004 05:17 PM

Ya I think I will check it out!

What do you mean when you said:
deb http://http.us.debian.org/debian xxxxx main contrib non-free

I put sarge in place of the xxxxx but this not work.

What goes in its place?

bvdb 06-09-2004 03:19 PM

Hello,

Quote:

Originally posted by Qzukk
... The "Stable" (aka Woody) means that every package you have access to has undergone significant testing ...

Pro: You can automate upgrades and get the latest security fixes without worrying that something will break.
Con: It will take months from now before php 4.3.x will appear in Stable, if it does at all (enough changes have been made that might break existing .php code... you see where this is going, right?)

..."Unstable" branch. Here, we have php4 4.3.4

Pro: Newest packages possible. This includes security fixes
Con: Newest packages are often untested and can break, sometimes seriously.
...

This position is biased towards the distro position of the game - of course the distro people are quick to declare "stable" what they have thorougly tested - month ago.

Declaring everything else as "unstable" is simply shifting the responsibility over to the (server) users. - Their view is different: In the meantime several vulnerabilities will have been discovered, published (and read by users as well as malicious hackers...) and fixed.
So the user is best advised to stick to new versions of his heavily-used apps (like apache, PHP, Perl, SSL etc.). A good distro will carefully balance the good sleep of the distro developers with the good sleep of the server users.

Not like debian, as it appears to me now:
PHP 4.3.7 is three steps (therein two "major bugfixes") ahead of the latest debian-"testing" version 4.3.4 ...

// Bernd vdB, Berlin

llamakc 06-09-2004 03:22 PM

Debian package maintainers regularly backport patches into the Stable tree. This is why Stable (currently Woody) users are encouraged to include the "security" apt-line in sources.list.

bvdb 06-09-2004 03:38 PM

Still no php 4.3.7
 
Hi,
http://www.apt-get.org/ gives me this when Isearch for "php" in "i386":

Warning: Supplied argument is not a valid PostgreSQL link resource in /md0/sites/apt-get.org/htdocs/lib.php


And in http://www.backports.org/ I did not find any php4.

// Bernd

llamakc 06-09-2004 03:41 PM

apt-get.org is broken atm. You can also download the source for php directly and build a deb. I gave up with Stable and pushed my servers to Testing. Works fine. A few programs (gallery, mailman) nutted up during the transition but I found answers here or on Google.

bvdb 06-09-2004 04:37 PM

Quote:

Originally posted by llamakc
... You can also download the source for php directly and build a deb. I gave up with Stable and pushed my servers to Testing.
Yes, of course I can install from sources, but then I could have used the time for learning the apt system better (like sailing?).

And, did I forget to mention, TESTING is already running here.

llamakc 06-09-2004 05:17 PM

Use apt-pinning. Install php4 out of experimental. Use google.com and find this:

http://bugs.dotdeb.org/main_page.php

Instructions on that site.

Debian can be very flexible too.

Good luck!


All times are GMT -5. The time now is 01:54 PM.