Can libcURL be configured to use my .curlrc when using PHP?

I use Drush and Drush Make to automate the loading of the Drupal module from the corporate network behind the NTLM-SSPI proxy server. Drush and Drush Make uses cURL to load files. cURL supports the NTLM-SSPI proxy server. I configured cURL for the proxy in my .curlrc file

--proxy proxy.example.com:8080
--proxy-ntlm
--proxy-user user:password

Drush itself can load modules from drupal.org, because it uses curlfrom the command line. But Drush Make uses the PHP cURL API (libcurl). It seems that when using this method, cURL does not use the configuration in my .curlrc file.

Is there a way to configure libcurl / php cURL with a .curlrc file?

+3
source share
2 answers

No, the entire .curlrc parser and all the logic associated with it are present only in the command line tool code. He does not enter the library at all. (and the PHP / CURL binding uses the libcurl library, not the command line tool)

+8
source

drush really loads the command line tool and runs it, so you can do this in the ~ / .curlrc file, but you need to make sure your commands are configured correctly.

leet@test:~$ cat ~/.curlrc
# Proxy manly for drush make
proxy = http://localhost:3128
# Drush make work around for https
#insecure

Can be done with ...

echo -e "\n# Proxy manly for drush make\nproxy = http://localhost:3128 \n /
#Drush make work around for https \n#insecure\n" >> ~/.curlrc

, . , , curlrc , bin, /etc/curl, .

, aegir.
, .

-1

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


All Articles