CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • API Path problem?
Pages: [1]

Author Topic: API Path problem?  (Read 789 times)

IsaacMars

  • Guest
API Path problem?
August 04, 2011, 08:23:07 pm
I'm getting path problems in the API files and can't find the magic setting that makes them go away!  Help appreciated!

The various require_once statements in the API seem to expect to be are called from the CiviCRM root directory

Example: a call to api.php (line 47) initiates a require_once statement for utils.php using the path 'api/v3/utils.php' and PHP throws an error because the file is located, relatively, at 'v3/utils.php'. Hack the core for a quick fix (tsk tsk), then same problem with "require_once 'CRM/Utils/String.php' (line 48). Hack that and then another one pops up in some different file later.

Clearly  there is some setting that's not appropriate - but I can't find it.

My CiviCRM root directory is set correctly in civicrm.settings.php, ending in "CiviCRM/" and everything else about Civi works just fine.  Using Drupal 7, Civi 4.05 and MAMP Pro 2.

Any thoughts on how to fix this problem?  Kinda hard to develop with the API if I can't actually access it.

IsaacMars

  • Guest
Re: API Path problem?
August 04, 2011, 08:46:30 pm
Doh!  Thread started earlier today on this topic: Thread # 20989.

The wisdom, finalized by lobo, is that the CiviCRM system needs to be initialized first.  Did as suggested and the problems are gone.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • API Path problem?

This forum was archived on 2017-11-26.