homepage Welcome to WebmasterWorld Guest from 54.166.65.9
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
apache php and fopen
very slow
dramstore




msg:3177073
 10:33 pm on Dec 3, 2006 (gmt 0)

Hi,

Wonder if anyone has had this problem, it's taken me all weekend to track this down, but finally got it to this stage:

I now have a file called a.php in my Linux server website root directory - nothing else in it but:

<?php
echo time() ;
$fp = @fopen("http://www.a-website-feed.com/feed.xml","r");
echo time() ;
?>

when I access www.mysite.com/a.php from IE - it takes about 25 seconds to complete.
On the server, when I go to the directory and run:
php a.php
it takes 2 seconds?

I guess its an apache/php problem. Has been working for ages now but suddenly causing problems.

Anyone any ideas?

Thanks

 

dramstore




msg:3177416
 11:25 am on Dec 4, 2006 (gmt 0)

just wondering - could it be possible that using via apache there is some dns problem, but not when run interactively?

mcavic




msg:3177542
 2:55 pm on Dec 4, 2006 (gmt 0)

Good thinking, but I don't think so. There shouldn't be any difference in DNS or firewall access. I have no idea what the problem could be, though. You could change the URL to [127.0.0.1...] to eliminate network issues.

dramstore




msg:3177619
 4:01 pm on Dec 4, 2006 (gmt 0)

Thanks for the idea.

The problem seems to have gone away for the time being, so I guess it must be some dns problem somewhere along the line as I have not changed anything on the machine, unless you can think of any other variable?

I will try that next time.

Thanks.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved