Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Trying to compare settings of two different PHP servers



On 2009-07-29 17:44 +0900 (Wed), Dave M G wrote:

> What I've tried to do, based on a little advice from the PHP mailing
> list, is download the output of phpinfo() from the misbehaving server
> and a working server to compare the differences. They seem, to my human
> eye, to be about the same. I tried running "diff -iw" on the files, but
> there was so much different between them that the output wasn't any more
> human readable.

Starting with the phpinfo() output is probably the right way to go here.
>From that point on, it's just a matter of playing with various tools to
try to extract the information you need, which is basically what Unix
was made for.

I would start with a non-unixy approach, however, and diff the two files
with meld, which is a graphical diff tool. This will highlight the words
within lines that are different as well, and may itself do the trick.

The next stage is usually to start massaging the files with
grep/sed/awk/perl/ruby/vi/whatever and then diff the massaged files.
The simpler approach is to run through and, for the different things
that aren't important (such as timestamps), remove them or replace them
with text that's the same. You'll also find sorting to be a useful
transformation when you do this; with some formats, running both files
through sort is the first thing I do before doing a comparison.

If mucking around that way doesn't help, you may have to go so
far as properly parsing the files. Before doing that, though, if
it's a one-off, consider just editing the files by hand (usually
deleting things) to make each successive diff show fewer non-relevant
differences. That's tedious, but it works.

It does sound to me, though, that in your situation you may want to do
this sort of thing on a regular basis, and having a tool to help would
be useful. As you go along with this, you may want to consider what
parts of what you've done you can reuse, and build some of that tool as
you go.

cjs
-- 
Curt Sampson       <cjs@example.com>        +81 90 7737 2974
           Functional programming in all senses of the word:
                   http://www.starling-software.com


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links