Uncaught exception 'ShopifyCurlException' with message 'Couldn't resolve host ''

671 views
Skip to first unread message

Steve

unread,
Apr 9, 2012, 3:23:11 PM4/9/12
to shopi...@googlegroups.com
Hello,

I'm using this PHP shopify client to build an app, deployed from my own server at site 5: https://github.com/cmcdonaldca/ohShopify.php.

I have a very simple bit of cost, which calls this Shopify.php client file:

<?php

require 'shopify.php'; 
$sc = new ShopifyClient($shop_domain, $token, $api_key, $secret); 
$productId = $_GET['id']; 
$fieldsArray = array( 
"namespace" => "video", 
"value" => 25, 
"key" => "video", 
"value_type" => "string"); 

$products = $sc->call('GET', '/admin/products/' . $productId . '/metafields.json', array('metafield'=> $fieldsArray)); 

?>

However, once I install the app on my Shopify test store I get the following error:

Fatal error: Uncaught exception 'ShopifyCurlException' with message 'Couldn't resolve host ''' in /home/kisswebm/public_html/shopify-apps/pre-order/shopify.php:71 

This is pointing to line 71 of the Shopify.php php client and this line is:

if ($errno) throw new ShopifyCurlException($error, $errno);

I believe it's a DNS issue and my server can't resolve the domain. I originally thought it may be that my Site5 host isn't accepting outgoing curl connections but I'm not sure. I'm waiting to hear back from their higher support.

The curl url is in this format: "https://{$this->api_key}:$password@{$this->shop_domain}/".

Doesn't any one know what the problem is. Am I making a mistake deploying an app from my hosting server? As you can tell I'm new to app. I'm experimenting with some simple apps to start with.

Many thanks for any help

Ben Dunlap

unread,
Apr 10, 2012, 11:27:52 AM4/10/12
to shopi...@googlegroups.com
Have you defined $shop_domain anywhere? Doesn't look like it from the code you posted, and that's what the error message suggests as well.

Ben

Reply all
Reply to author
Forward
0 new messages