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) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • drupal profile path problem for cron.php
Pages: [1]

Author Topic: drupal profile path problem for cron.php  (Read 1326 times)

Masked Marauder

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
  • \__^..^
  • CiviCRM version: 4.5.5
  • CMS version: drupal-6.34
  • MySQL version: 5.5.40-36
  • PHP version: 5.4.34
drupal profile path problem for cron.php
April 12, 2012, 06:08:48 pm
I just upgraded from 3.4.8 to 4.1.1 under drupal 6.  No problem for normal access through the http forms & such.

I'm having trouble getting the cron.php to run the job stuff.

A peculiarity of the site is that its using a profile-run site (aquia commons to be exact) so the civicrm distribution bin is in /.../profiles/drupal_commons/contrib/civicrm/, not the usual /.../sites/modules/civicrm/

when I try to do it by getting 'http://XXX/profiles/drupal_commons/modules/contrib/civicrm/bin/cron.php?name=YYY&pass=ZZZ&key=site-key', I get this error:
Quote
Could not find valid configuration dir, best guess: /.../profiles/drupal_commons/modules/contrib/civicrm/../../sites
   If this is a standalone installation (i.e. not a Drupal or Joomla module) and you'd like to re-initialize it, click here.

I tried linking the real 'sites' directory where it expected it, but it didn't help.  It should be looking in .../sites/default for the config file anyway.

I've never worked with the new job scheduler and I'm not sure how much of this is me requesting the wrong url, or if my configuration is broken.  Is there a way to specify the proper custom path explicitly?  I didn't see it in the directories form.

general_ludd

  • I’m new here
  • *
  • Posts: 24
  • Karma: 1
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7.x
  • MySQL version: 5.1.62-0ubuntu0.10.04.1
  • PHP version: PHP Version 5.3.2-1ubuntu4.14
Re: drupal profile path problem for cron.php
May 07, 2012, 04:08:42 pm
Did you ever find a solution to this? I just upgraded a site from 4.0.8 to 4.1.0. I had not set up cron yet for the site, but get the same error you describe. My site is configured so civi is in default instead of all because we are using a D7 shared codebase and the "/sites/all" folder is symlinked to the shared sites/all directory.

Masked Marauder

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
  • \__^..^
  • CiviCRM version: 4.5.5
  • CMS version: drupal-6.34
  • MySQL version: 5.5.40-36
  • PHP version: 5.4.34
Re: drupal profile path problem for cron.php
May 08, 2012, 08:25:21 am
Yes.  In the end the simplest solution was to meet CiviCRM's expectation.  I moved the CiviCRM module top directory to the location the error message indicated and all was well.

Depending as it does on backtrack paths (ie ../../whatever/X.php) the CiviCRM code in the cron stuff is sensitive to absolute directory structures and can get confused by logical link tricks if it backtracks above the root module directory.  I modified the relevant CiviCRM files to deduce internal file locations from a different authority, and it worked.  But it was clear that it would be too difficult to maintain since any package update would clobber the changes I'd made.  So I chickened out and put the package where the package assumed it would be.

I don't know about D7, but with D6 & D5 the module aspect is fully contained under the root subdirectory its in and so is immune to any logical link jiggery-pokery I need to make other things work so satisfying CiviCRM's stricktish needs doesn't harm it's drupal functionality.

general_ludd

  • I’m new here
  • *
  • Posts: 24
  • Karma: 1
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 7.x
  • MySQL version: 5.1.62-0ubuntu0.10.04.1
  • PHP version: PHP Version 5.3.2-1ubuntu4.14
Re: drupal profile path problem for cron.php
May 08, 2012, 12:13:17 pm
I read the information aboutmulti-site configurations http://wiki.civicrm.org/confluence/display/CRMDOC40/CiviCRM+for+Drupal+-+Configure+Multi-site+Installations. If you add a file called settings_location.php into the civicrm module folder (wherever it may be symlinked) and add the following to the file:
Code: [Select]
<?php 
define
( 'CIVICRM_CONFDIR', '/[path-to-drupal]/htdocs/sites/' );

Not sure why this can't be defined in the civicrm.settings.php file instead since that would be a more logical place to define site-related constants.
« Last Edit: May 08, 2012, 12:36:40 pm by general_ludd »

Masked Marauder

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 1
  • \__^..^
  • CiviCRM version: 4.5.5
  • CMS version: drupal-6.34
  • MySQL version: 5.5.40-36
  • PHP version: 5.4.34
Re: drupal profile path problem for cron.php
May 08, 2012, 01:07:49 pm
I wasn't aware of this.  Thanks for bringing it to my attention.  I'll probably use it in the next upgrade.

Since a lot of constants are defined in civicrm.settings.php I expect CIVICRM_CONFDIR could be defined there as well, its just that it doesn't usually need to be & so isn't there.

But the problem I found was that the crontab tasks thing backtracked above the link and couldn't find its way back down.  I'm not sure redefining CONFDIR would solve that.

hebbar10

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.4.3
  • CMS version: drupal 6 and 7
  • MySQL version: 5.5.34
  • PHP version: 5.3
Re: drupal profile path problem for cron.php
August 27, 2012, 04:24:56 am
I was getting the same error message. For this in civicrm.config.php line 72(I am using civicrm 4.1.5v for drupal 6), I replaced "sites" with ".." which solved the issue. Now I am able to run cron.php for civicrm without error message.
Here my files locations,
civicrm.settings.php= /drupal-root/sites/<sitename>/civicrm.settings.php
civicrm.config.php   = /drupal-root/sites/<sitename>/modules/civicrm/civicrm.config.php.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • drupal profile path problem for cron.php

This forum was archived on 2017-11-26.