cannot redeclare civicrm_api3_pcp_create

Published: Aug 21, 2017

If Vagrantfile has
nfs: true as in
config.vm.synced_folder ".", "/vagrant", nfs: true,
then cv/api explorer will cry cannot redeclare civicrm blah blah blah

Last modified: August 21, 2017 8:22 pm
Posted in: Snippets

cv and civix blank output

Published: Jun 19, 2017

CiviCRM 4.6.4, Vagrant

Running cv vars:show outputs nothing
including adding -vvv
and civix civicrm:ping -vvv output is

[Bootstrap] Options: {
    "dynamicSettingsFile": "phar:///usr/local/bin/civix/vendor/civicrm/cv/settings_location.php",
    "env": "CIVICRM_SETTINGS",
    "prefetch": false,
    "settingsFile": null,
    "search": true,
    "cmsType": null,
    "httpHost": "",
    "output": {

[Bootstrap] Find settings file
[Bootstrap] Load supplemental configuration for "/vagrant/mysite/wp-content/plugins/civicrm/civicrm.settings.php"
[Bootstrap] Load settings file "/vagrant/mysite/wp-content/plugins/civicrm/civicrm.settings.php"

Turns out that if my civicrm.settings.php has variables, wont work!


$wordpress_root = '/vagrant/mysite/';
$website_address = '';

define( 'CIVICRM_UF_BASEURL'      , $website_address );

global $civicrm_setting;

// Temporary Files (System Settings > Directories)
$civicrm_setting['Directory Preferences']['uploadDir'] = $wordpress_root . 'wp-content/plugins/files/civicrm/upload' ;

// Images (System Settings > Directories)
$civicrm_setting['Directory Preferences']['imageUploadDir'] = $wordpress_root . 'wp-content/plugins/files/civicrm/persist/contribute' ;
Last modified: June 19, 2017 4:47 pm
Posted in: Snippets

CiviCRM Dashboard Redirects

Published: Mar 26, 2017

CiviCRM 4.6.4 in vagrant with apache.

Opening the CiviCRM dashboard auto redirects to an ISP page. Turns out the site cannot call itself. Vagrantfile has
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.ssh.forward_agent = true "private_network", ip: ""

To solve, edit the vm’s /etc/hosts and in addition to the localhost, add the Vagrantfile’s private_network ip:

echo '
' | sudo tee /etc/hosts > /dev/null

Last modified: May 26, 2017 1:21 pm
Posted in: Snippets