php-echonest-api icon indicating copy to clipboard operation
php-echonest-api copied to clipboard

"CURLOPT_FOLLOWLOCATION" preventing the response from being returned

Open ayhid opened this issue 10 years ago • 0 comments

Hello, In some cases when the php safe mode is enabled or an open_basedir is set on the server, the curl_setopt_array cannot set the CURLOPT_FOLLOWLOCATION option. It also prevents the CURLOPT_RETURNTRANSFER option from being set as it's defined after in the following array: $curlOptions += array( CURLOPT_URL => $url, CURLOPT_PORT => $this->options['http_port'], CURLOPT_USERAGENT => $this->options['user_agent'], CURLOPT_FOLLOWLOCATION => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => $this->options['timeout'] );

In my use case I just commented out the CURLOPT_FOLLOWLOCATION line and it seems to work very well. I am not sure if it will be ever needed with echonest responses.

ayhid avatar May 25 '14 19:05 ayhid