Hello,
you need to make sure that PHP script is allowed to access your website. You can check this by using a test script like this:
<?php
$initurl = '[ External links are visible to logged in users only ]';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $initurl);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$fdata = curl_exec($ch);
curl_close($ch);
print_r($fdata);
Save it as PHP file and open in browser.