[wikka-community] fopen('http://localhost/', 'r');

Mahefa Randimbisoa dotmg
Tue Oct 9 14:34:55 GMT 2007


<disclaimer>I'm not a C developer, and many times, I misuse terms when speaking.</disclaimer>
 
On some installation, Apache (or PHP), is configured to be ableto run one instance (or thread? I don't know the exact wording)and only one instance at a time.
That means that requests to get a ressource from the webserverare queued, and the server doesn't process them until the currentone it is processing has finished.
 
Problem arises when you use fopen() with the same base URL as the pagewhere you're calling it to get ressource from the machine. For Wikka,it is the case for actions like {{rss url="http://example.com/recentchanges.xml"}}.
 
This is what happen when you include a code like this inside a pageat http://example.com/TesT
1) client sends request for http://example.com/TesT2) server starts processing TesT3) server sends itself request for recentchanges.xml, which will be queued4) server waits for himself to deliver the ressource recentchanges to end processing TesT. It waits TesT to be processed to start processing recentchanges.
This kind of circular reference (endless loop? <span lang='fr'>cercle vicieux</span>?) will makeboth 2 resources not available.
 
I've seen what one called multithreading to avoid this: Instead of using fopen()to get the ressource recentchanges.xml, the php script uses system() to create another process that call php to process the page. I'm reluctant to try that when I think of another configuration issue: safe_mode. I think trying to solve this problem will be just bloating WikkaWiki. I'd prefer just to mention thatsome Apache installation might be unable to process page when using {{rss}} with resource at the same Virtual host of the same server.
I've post a comment on page 
http://wikkawiki.org/SpamBlacklist 
that we should consider.--Remerciements,Mahefa
_________________________________________________________________
T?l?chargez le nouveau Windows Live Messenger !
http://get.live.com/messenger/overview
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.wikkawiki.org/pipermail/community_wikkawiki.org/attachments/20071009/87769399/attachment.html 



More information about the community mailing list