tags:

views:

202

answers:

0

Using drupal 6.15 and CiviCRM 3.1.2. Need Webform to put values into the CiviCRM sql database, and trying to use the CiviCRM API to do so. Have been editing the file: .../modules/webform/webform_submissions.inc, adding the following lines:

/* Initialize CiviCRM so that the API's can be used */
ini_set("include_path", ".:/usr/local/php5/lib/php:/usr/local/lib/php:/home/<path>/sites/all/modules/civicrm:/home/<path>/sites/all/modules/civicrm/packages");

require_once 'CRM/Core/Config.php';
$config =& CRM_Core_Config::singleton();

// Load the required CiviCRM API's */
require_once('api/v2/Contact.php');

Gives the error:

You need to define CIVICRM_UF in civicrm.settings.php

When adding:

 civicirm_initialize(true);

Error:

Fatal error: Cannot redeclare _pear_call_destructors() (previously declared in /usr/local/lib/php/PEAR.php:771) in /home/<path>/sites/all/modules/civicrm/packages/PEAR.php on line 811

Any help?

related questions