views:

71

answers:

2

If server has php libcurl enabled, does it have all setopt options available (unless something new was added in new libcurl version and server didn't upgraded, of course) or is it possible for admins to turn off parts of functionality?

I'm especially thinking about CURLOPT_HTTPHEADER - can i assume that if i'll be running my script on server(s) with enabled curl that i will be able to use CURLOPT_HTTPHEADER? Or is it possible that admins turned off this option alone?

+1  A: 

All you're doing when setting a cURL option is defining a constant within your cURL object. As far as I'm aware, the admin can't prevent you from defining a specific constant, so you should be safe in that regard.

BraedenP
+2  A: 

Although the admins can't directly turn off any of the options, as BraedenP said, they can indirectly affect some of them with the open_basedir and safe_mode settings in php.ini. There are also curl settings in php.ini (viewable with phpinfo()) that may or may not affect some options.

GZipp
ok, so do you think these disable CURLOPT_HTTPHEADER or rather not?
Phil
I don't think CURLOPT_HTTPHEADER is affected only CURLOPT_FOLLOWLOCATION and the like...
Alix Axel
What eyze said applies to open_basedir and safe_mode. But when I reread my answer just now, I realized that the other part of it was wrong. The settings shown with phpinfo() aren't from php.ini, but from the compilation of php and curl. Most of them are libcurl settings and unchangeable, as the typical installation of PHP uses libcurl as a bundled library. I'll edit my answer.
GZipp