79173105

Date: 2024-11-09 15:47:39
Score: 0.5
Natty:
Report link

After a lot of debugging, tracing, it comes from the useragent

Curl called from command line send a default useragent string (like curl/7.41)

phpcurl by default send no user agent , and now OVH refuse this calls

I simply added :

$ch = curl_init(wswwwurl); 
/* !!! useragent is now MANDATORY when calling OVH !!! */ 
$config['useragent'] = 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0';
curl_setopt($ch, CURLOPT_USERAGENT, $config['useragent']);

And it's now ok again !

rem : I tried to add CURLOPT_FOLLOWLOCATION, but then OVH server redirects to another page "blocked request"

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: VinceSax Maury