Search code examples
phpperlcurlfastcgilwp

cUrl to perl FCGI script


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?


Solution

  • 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.