PHP remote Include fails - telnet/web browser succeeds

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have a script that does a remote include (does not matter if I do
include(), file(), require(), etc, the result is the same).

The script spins for a long time and then will finally return (edited
for internet consumption):

Warning: blahFunction( ): failed to open
stream: Connection timed out in
/var/www/html/project/functions/myscript.php on line 28

Warning: blahFunction(): Failed opening
' ' for inclusion
(include_path='.:/usr/local/lib/php') in
/var/www/html/project/functions/myscript.php on line 28

I can succesfully run the same logic from a different server, and this
had been working prior to our move.  If I telnet from the server to
" 80" and issue a "get /header'" the expected result
comes back immediately.  Also if I go to
" " in my  browser (the browser is not
being run from the server but same subnet) I get the results that I
expect back immediately.

Because of the move, I suspect it has to do with DNS issues.  It's not
a matter of waiting for names to propagate as we are resolving them
internally and - as shown above - they do indeed resolve as expected.

I would buy it if you told me that I had a reverse-DNS issue - I just
don't know how to go about resolving it.

So I guess I'm asking

1:  Does it seem like a reverse-DNS issue?
2:  If it is, then how do I go about resolving it?
3:  If it is not, then what are my other possibilities?

And just out of curiosity -

4: Why would telnet be able to resolve this correctly, but not PHP?
Especially since both are being tested from the same box.


Re: PHP remote Include fails - telnet/web browser succeeds

ChronoFish wrote:
Quoted text here. Click to load it

E. Dronkert

Re: PHP remote Include fails - telnet/web browser succeeds

Hi Ewoud,

Those are good resources, but unfortunately they are no applicable.

Here are some more odd issues:

First of all the code is being run from
"http://someserver/project/myscript.php" and the "include" file is

So yes I am including a file through the local webserver rather than
just including the php directly -  this is by design (I know it sounds
strange, but the rest of the details are unimportant).

If I do a


the correct IP comes back instantly (lets say for this
example).  If I do a

file(" ")

This will come back as expected.  If I hit the box from a different
server with


this will come back as expected.  It's only when I do a


from the server "someserver" (i.e. the script calls a script on the
same server) does the response time-out.


Site Timeline