Re: Something is messing up the php output

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

 



On Wed, June 22, 2005 6:26 pm, Jonathan Duncan said:
> I have a site that has this problem every once in a while, and seemingly
> randomly.  It is a database driven site, as indicated by the error.  This
> same page when loaded numerous times will sometimes work just fine, and
> then
> sometimes it will give an error message like this:
>
> -----------------------------------------------------
> Warning: mysql_connect(): Unknown MySQL Server Host
> 'hostn[]me.domain.com' (1) in
> /usr/local/apache/htdocs/filename.php on line 8
> Unknown MySQL Server Host 'hostn[]me.domain.com' (1)
> -----------------------------------------------------
>
> Notice that in the word "hostname" the 'a' is not an 'a'.  It is one of
> the
> empty boxes that usually indicates an unknown character.  Here I represent
> it with square brackets for visual effect.
>
> When the source is check, there is absolutely nothing wrong with the
> hostname in the mysql_connect function.  As I mentioned, if this page is
> reloaded it may be fine.  After a while it may not have anymore problems
> for
> weeks.  Or it may come back the next day.  When It is happening I do not
> notice any major server process usage.
>
> The mis-interpreted character problem sometimes truncates a word, or just
> messes up a cerain random characters.
>
> I have had this happen on more than one site on more than one server.
>
> Does anyone have any idea what this may be?  I am even accepting wild
> guesses at this point.

WILD GUESS ALERT!
Until you said "on more than one server" I was thinking a heat-related
intermittent hardware error corrupting the file read, so "a" turned into
some not-quite-random character...  You *SURE* it's on multiple
servers?...

Are all machines running the same software versions?

Are you using multi-byte strings?  Those are not quite as pounded on as
much as one might like...

Have you done anything funky to force libc->glibc upgrade?

Or a kernel upgrade?

Are you running anything bleeding/leading edge? (Apache 2, PHP 5, mysqli
etc)  Can you rollback for awhile and test?

If you are using Apache 2, are you in that pre-fork mode, or is it running
threaded?

What PHP Modules are you running?

Aha!  My wild guesses have lead me to a hypothesis:

You *are* using Apache 2 in threaded environment and some PHP Module (or
other software) is not thread-safe.

*WHICH* one[s] are not thread-safe is totally open to question...

It could even be some weird interaction between *TWO* Modules that very
rarely exhibits itself by random changing of memory bits.  Ugh!

Are there any Modules you could get rid of completely and just change the
applications to "do without"?

Do you have a test Development box that exhibits this behaviour?  Run it
and ab stress test it and pound on it with as many different requests in
as random an order you can achieve.

If you can get the dev box to mis-behave somewhat reliably, try getting
rid of one PHP Module after another, and re-test incessantly.

Could you roll back to Apache 1.x or at least do that pre-fork thing so
you are not using threads on the production server, and see if it goes
away?

Some of the above questions/implications are mutually exclusive. :-)

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux