If you set CURLOPT_RETURNTRANSFER
to true
or 1
then the return value from curl_exec
will be the actual result from the successful operation. In other words it will not return TRUE
on success. Although it will return FALSE
on failure.
As described in the Return Values section of curl-exec
PHP manual page: http://php.net/manual/function.curl-exec.php
You should enable the CURLOPT_FOLLOWLOCATION
option for redirects but this would be a problem if your server is in safe_mode
and/or open_basedir
is in effect which can cause issues with curl as well.