i got an error
CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in
i google many
If you specify that only http and https protocols are allowed during redirect using CURLOPT_REDIR_PROTOCOLS, you would be able to use CURLOPT_FOLLOWLOCATION without safe_mode or open_basedir.
CURLOPT_REDIR_PROTOCOLS
CURLOPT_FOLLOWLOCATION
safe_mode
open_basedir