I was just dealing with this and found your question..
Since you used C:\
, i'll assume you're in windows.
TLDR; Try checking your PHP environment variable for 'HOMEPATH' vs 'HOME' and editing the file I mention below.
The first thing I will say is that you can increase verbosity of errors in civix by using -v
, -vv
, or -vvv
options for most verbose. It helped me a lot with this issue.
I will leave the important details of my environment here as well, for others who may find this question:
A working Drupal 7 + CiviCRM 4.7.17 locally installed (manually) with MAMP on a Windows 10 machine, configured to use PHP 5.6.28. MAMP is installed to C:/MAMP
and the site root is C:/MAMP/htdocs/drupal/
Civix is installed to C:/Users/"Eli Lisseck"/
and I am seeing the same behavior as you that civicrm:ping throws and exception.
Running the more verbose command civix civicrm:ping -vvv
led me to the file C:\Users\Eli Lisseck\civix\vendor\civicrm\cv\src\Config.php
line 54.
Check if it is looking for your HOME environment variable correctly, versus what you have under environment variables when you run php -i
. I found it was only looking for 'HOME' but what existed was 'HOMEPATH'... so I added at line 52:
elseif (getenv('HOMEPATH')) {
$file = getenv('HOMEPATH') . '/.cv.json';
return $file;
}
Now I get civix civicrm:ping Ping successful
Hope this is helpful!