dphfwzn8269 2014-08-07 10:07
浏览 29
已采纳

cUrl to perl FCGI脚本

I'm having to re-create existing code in php.

A perl script which implements FCGI::Request() is connected to via LWP::UserAgent->credentials()

How would I connect to this script using cUrl (php) instead of LWP (perl)?
Or, What is a better/more suited method of connection to such from php?

  • 写回答

1条回答 默认 最新

  • douzhuang2016 2014-08-07 10:54
    关注
    curl_setopt($ch, CURLOPT_USERPWD, urlencode($username) . ':' . urlencode($password));
    

    Where $ch is $ch = curl_init(); Rest are self explanatory.

    Also see: How do I make a request using HTTP basic authentication with PHP curl? and Client URL Library.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?