0

iam using that php code in the localhost and working fine

$ch = curl_init($src);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_exec($ch);
$url = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); 

when i move it to the remote server the script ignores that code

and doesn't give me a result (still giving me the original url )

note: i use cURL here to give me the true url after redirect

3
  • Is there anything in the php error log or the apache logs. Does the remote server have the curl extension enabled?
    – RiggsFolly
    Nov 2, 2013 at 1:03
  • yeah the cUrl is enabled and i have no access to those logs :( Nov 2, 2013 at 1:16
  • thank you problem solved it was the host restricting outgoing connections :) Nov 2, 2013 at 1:19

1 Answer 1

0

Maybe there is some difference in the configuration of the remote server.

phpinfo();

Shows the configuration of php and of the curl module

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.