cURL request to plugin repository fails 403

[ad_1]

I have just tested this. A curl on the console works without any problems. However, it only works via PHP if you set the UserAgent to a browser. So with such a specification in the code:

$ua = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13';
curl_setopt( $cd, CURLOPT_USERAGENT, $ua);

If this still doesn’t work for you, please show the code you used to see where the difference is.

YES! Thanks so much, that worked.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer