Page 1 of 1

Is curl standard for hosts?

Posted: Mon Oct 03, 2005 8:27 pm
by Envex
Hey guys,

Quick question. Does anyone know is enabling curl with PHP is a standard in the web hosting industry? In other words, if I develop something that thousands will use on a wide variety of servers, is a curl requirement going to cause a headache for most people? Or do the majority of web hosts out there already have curl enabled, so they'll be able to install the software without any problem?

Assuming it'll be used on hundreds of different web hosts, should I make the software dependant on curl, or write my own code to take care of it?

Thanks alot,
Matt

Posted: Mon Oct 03, 2005 8:33 pm
by feyd
always write a wrapper to external systems. Depending on your goals, I'd suggest you write your wrapper to work with cURL as well as fsockopen(), maybe even fopen()

Posted: Mon Oct 03, 2005 8:44 pm
by Envex
I'm sorry, but what would be the advantage of that? In that case, why wouldn't I just write the software to use only fsockopen() if basically every server with PHP supports it, instead of a wrapper that supports all three? I'm sure there's an advantage in doing so, but I can't see it. Any advice?

Thanks,
Matt

Posted: Mon Oct 03, 2005 8:52 pm
by feyd
fsockopen() could be disabled, fopen() could be disabled.. the wrapper is there so you only have to write the interaction code once, but you can use it in many locations.. saves you from having to change many locations (and potentially adding odd bugs)..

Posted: Mon Oct 03, 2005 9:01 pm
by protokol
I would think most hosts include curl because it's just a command-line http request. Very useful tool