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 »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • civicrm.config.php call in UpdateMembershipRecord.php with Joomla
Pages: [1]

Author Topic: civicrm.config.php call in UpdateMembershipRecord.php with Joomla  (Read 2511 times)

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
civicrm.config.php call in UpdateMembershipRecord.php with Joomla
December 04, 2007, 06:27:38 am
When I run UpdateMembershipRecord.php as a cron job it returns errors
Quote
PHP Warning:  require_once(../civicrm.config.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /home/bertie/public_html/administrator/components/com_civicrm/civicrm/bin/UpdateMembershipRecord.php on line 37 <br />
<b>Warning</b>:  require_once(../civicrm.config.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in <b>/home/bertie/public_html/administrator/components/com_civicrm/civicrm/bin/UpdateMembershipRecord.php</b> on line <b>37</b><br /> PHP Fatal error:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required '../civicrm.config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bertie/public_html/administrator/components/com_civicrm/civicrm/bin/UpdateMembershipRecord.php on line 37 <br /> <b>Fatal error</b>:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required '../civicrm.config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in <b>/home/bertie/public_html/administrator/components/com_civicrm/civicrm/bin/UpdateMembershipRecord.php</b> on line <b>37</b><br />

Line 37 is require_once '../civicrm.config.php';

Using the civicrm-1.9.12432-joomla-php5 distro (joomla 1.0.12) the file \com_civicrm\civicrm\civicrm.config.php exists but I don't see it on my site. It only contains Drupal specific calls to locate the appropriate configuration file.

I'm assuming this is a small bug but am not sure what effect it has on the rest of the script. Can I assume that it can just be commented out?


speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Re: civicrm.config.php call in UpdateMembershipRecord.php with Joomla
January 02, 2008, 03:08:55 am
Finally got UpdateMembershipRecord.php using civicrm-1.9.12432-joomla-php5 distro (joomla 1.0.12) to run but it took some investigation.

As mentioned before the call on line 37 Line 37 is require_once '../civicrm.config.php'; refers to the file
\com_civicrm\civicrm\civicrm.config.php which is not installed as part of the Joomla install.

I extracted the file from the distro and copied it onto my site. This then threw an error relating to not finding a settings_location.php file which would appear to ve a drupal specific install requirement. I created this file /public_html/administrator/components/com_civicrm/civicrm/settings_location.php
Code: [Select]
<?php
define
( 'CIVICRM_CONFDIR', '/home/your_server/public_html/administrator/components/com_civicrm' );
?>



However civicrm.config.php was still erroring due to an a FIXME: problem spot for Drupal 5.1 config dir layout
to fix I simply changed
Code: [Select]
    $conf = "$confdir/default";
    return $conf;
to
Code: [Select]
    $conf = "$confdir";
    return $conf;

While this works I don't see this as being a clean solution. It basically works around the drupal process and I suspect that a much cleaner solution is possible.

Should I raise this as an issue for Joomla installs?
« Last Edit: January 02, 2008, 03:56:18 am by speleo »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: civicrm.config.php call in UpdateMembershipRecord.php with Joomla
January 02, 2008, 08:10:05 am

I suspect you did a manual / svn install at some point. The joomla component installer script, overwrites the default civicrm.config.php file with a file specific for that installation. On my localhost, the contents of the file is:

Code: [Select]
<?php

require_once '/Users/lobo/public_html/joomla-1.0.13/administrator/components/com_civicrm/civicrm.settings.php';

?>

A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Re: civicrm.config.php call in UpdateMembershipRecord.php with Joomla
January 02, 2008, 08:26:34 am
thanks Lobo, that makes sense now. Took a look at the installer and see the code to do that. My original install was 1.5 (7023) and I've upgrade each release since then. Don't remember doing a manual or SVN install but thats not really important now.

Looking forward to v2.0. Many thanks for your hard work,

Henry

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • civicrm.config.php call in UpdateMembershipRecord.php with Joomla

This forum was archived on 2017-11-26.