{"id":6834,"date":"2014-04-23T08:10:57","date_gmt":"2014-04-23T08:10:57","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/23\/getting-fatal-error-uncaught-curlexception-26-couldnt-open-file-collection-of-common-programming-errors\/"},"modified":"2014-04-23T08:10:57","modified_gmt":"2014-04-23T08:10:57","slug":"getting-fatal-error-uncaught-curlexception-26-couldnt-open-file-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/23\/getting-fatal-error-uncaught-curlexception-26-couldnt-open-file-collection-of-common-programming-errors\/","title":{"rendered":"Getting Fatal Error Uncaught CurlException: 26: couldn&#39;t open file-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/graph.facebook.com\/100002566088976\/picture?type=large\" \/><br \/>\nNarendra Rajput<\/p>\n<p>I am trying to create a dynamic image of my friends using PHP&#8217;s GD Library, and I need to upload this to my Friends Profile but I keep getting an Error Fatal error: Uncaught CurlException: 26: couldn&#8217;t open file &#8220;&#8221; thrown in \/home\/p170r760\/public_html\/myfbapps\/mysupporters\/base_facebook.php on line 820<\/p>\n<pre><code>$image = imagecreatetruecolor(500, 500);\n$orange = imagecolorallocate($image, 0xFF, 0x8c, 0x00);\n$bg = imagecreatefromjpeg('app2_bg.jpg');\nimagesettile($image, $bg);\nimagefilledrectangle($image, 0, 0, 499, 499, IMG_COLOR_TILED);\n$font_file = 'TURNBB__.TTF';\nimagefttext($image, 20, 0, 105, 50, $orange, $font_file, 'My Top Supporters');\nfor($i=0;$iapi('\/'.$mutual_friends[$i]['id'].'?fields=picture&amp;type=square');\n$frnd = imagecreatefromstring(file_get_contents($frnd_pic['picture']));\nimagecopymerge($image,$frnd,150,(80+($i*80)),0,0,50,50,100);\n$tags[] = array(\n       'tag_uid' =&gt; $mutual_friends[$i]['id'], \/*Current user's id*\/\n       'x' =&gt; (150\/5),\n       'y' =&gt; ((80+($i*80))\/5)\n   );  \n}\nimagepng($image, '\/img\/' . $me['id'] . '.png');\n$pic = realpath(\"\/home\/p170r760\/public_html\/myfbapps\/mysupporters\/\" . $me['id'] .  '.png');\n$facebook-&gt;setFileUploadSupport(\"http:\/\/\" . $_SERVER['SERVER_NAME']);\n$pic_id = $facebook-&gt;api('\/me\/photos', 'POST', array('message' =&gt; 'My Top Supporters',\n'source' =&gt; '@' . $pic,\n'tags' =&gt; $tags));\n imagedestroy($image);\n ?&gt;\n<\/code><\/pre>\n<p>Can anyone please tell me where am I going wrong?<\/p>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/graph.facebook.com\/100000109274242\/picture?type=large\" \/><br \/>\nbkvirendra<\/p>\n<p>The setfileUploadSupport API you used is not supported by PHP SDK 3.1 in line<\/p>\n<pre><code> $facebook-&gt;setFileUploadSupport(\"http:\/\/\" . $_SERVER['SERVER_NAME']);\n<\/code><\/pre>\n<p>Change it<\/p>\n<pre><code> $facebook-&gt;setFileUploadSupport(true)\n<\/code><\/pre>\n<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7f45da72d024991fc2ccc3759272d307?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJuicy Scripter<\/p>\n<p>You&#8217;re saving file in the <code>\/img\/{$me['id'}.png<\/code> but trying to upload it from other path&#8230;<\/p>\n<p><code>\/home\/p170r760\/public_html\/myfbapps\/mysupporters\/{$me['id']}.png<\/code> isn&#8217;t the same as <code>\/img\/{$me['id'}.png<\/code><\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Narendra Rajput I am trying to create a dynamic image of my friends using PHP&#8217;s GD Library, and I need to upload this to my Friends Profile but I keep getting an Error Fatal error: Uncaught CurlException: 26: couldn&#8217;t open file &#8220;&#8221; thrown in \/home\/p170r760\/public_html\/myfbapps\/mysupporters\/base_facebook.php on line 820 $image = imagecreatetruecolor(500, 500); $orange = imagecolorallocate($image, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6834","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6834"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6834\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}