Is there a way to change the default values ​​for php curl options, for a script session or globally?

I use a framework that handles curl encapsulated in the depths of its class hierarchy. Basically, I would like to change the way curls are handled without fixing files. This might be ideal if I could change the default swirl values ​​around the world. In php.ini or similar.

Can this be done?

+3
source share
3 answers

For the most part, this can only be done with reference to the used cURL descriptor.

There is only one php.ini directive for cURL ( curl.cainfo) since PHP 5.3.7:

http://www.php.net/manual/en/curl.configuration.php

+3

curl curl_setopt. , - .

, - , .

+1

fooobar.com/questions/532085/...

PHP:

ini_set("default_socket_timeout", 6000);

/ .htaccess :

php_value default_socket_timeout 6000

phpinfo()

0

Source: https://habr.com/ru/post/1754072/


All Articles