CURLOPT_FOLLOWLOCATION will not work if, within your php configuration ,
- safe_mode = On
- open_basedir is set
So, changing one or both of them should fix the issue. There are 3 places to achieve this.
In php.ini
safe_mode
= Off, and comment out the open_basedir
In apache .conf or .htaccess
php_value safe_mode Off
php_value open_basedir none
Note that your server configuration must allow for values override in order to work on .htaccess.
Also note that CURLOPT_FOLLOWLOCATION has been deprecated since php 5.3, and removed in php 5.4.