Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to work out if PHP was installed as part of a generic apt-get package, compiled from source or installed some other way on Ubuntu?

I need to recompile it with some more options and I want to try and follow the correct upgrade path.

share|improve this question
2  
If you're going to compile it with different options, consider making a package of your version, so that it can be tracked in the future... –  ghoti Dec 16 '11 at 12:19
add comment

2 Answers

up vote 5 down vote accepted

You can check if the package is installed with:

 dpkg -l |grep php

and can check if the files on your system is consistent with the package with

 debsums packagename

from this you can have some clues about the origin of the package.

share|improve this answer
add comment

you may want to run as root

root@machine:~# dpkg -l php5 (or whatever version you have)

if php was installed using packet manager, this command will retun some thing like

root@machine:~# dpkg -l php5
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                   Version                                Description
+++-======================================-======================================-============================================================================================
ii  php5                                   5.3.2-1ubuntu4.10                      server-side, HTML-embedded scripting language (metapackage)

notice the content of the first comumn wich is "ii" else , you will have the same output but with the first column containing "un" instead of ii

share|improve this answer
add comment

Your Answer

 
discard

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.