I am trying to install CiviCRM with Drupal 4.7. Drupal is installed at below path.

C:\Program Files\Apache Group\Apache2\htdocs\drupal

While trying to install modules I got the below error message.

“warning: require_once(CRM/Core/Block.php) [function.require-once]: failed to open stream: No such file or directory in C:\Program Files\Apache Group\Apache2\htdocs\drupal\modules\civicrm\drupal\civicrm.module on line 157.”

I had to make below change in civicrm.settings.php. I was able to install modules successfully with the below change.

$civicrm_root = '/drupal/modules/civicrm/';

When I click on the Blocks link for installing the blocks, below error is displayed.

Fatal error: require_once() [function.require]: Failed opening required 'CRM/Core/Block.php' (include_path='.;/drupal/modules/civicrm/;/drupal/modules/civicrm/\packages;.;C:\php5\pear') in C:\Program Files\Apache Group\Apache2\htdocs\drupal\modules\civicrm\drupal\civicrm.module on line 157

Please let me know whether this is a bug or something more needs to be done to configure?

Thanks.

Comments

bjornarneson’s picture

This line in your second error:

(include_path='.;/drupal/modules/civicrm/;/drupal/modules/civicrm/\packages;.;C:\php5\pear')

...leads me to believe that you've got a misplaced/missing single quote in your civicrm.settings.php file.

b

ladycentaur’s picture

Installing CiviCRM 1.5 onto Drupal 4.7 WITHOUT using Command Line

Before you begin make sure you have a working Drupal 4.7 already installed. Have the name of the database, database user and password handy as well as the name of your mysql host. If you can’t find the name of your mysql host anywhere on your host’s site then your mysql host is probably localhost. Save yourself the aggravation and get all these things written down beside you before you even start installing CiviCRM.

1. Use FTP to upload the zip/tar CiviCRM directly into the drupal/modules folder.

2. Go to your Control Panel or whatever method you use to create new databases and create a new database called civicrm. You will already have a database user name and password from your Drupal installation. Go to your list of database users and add a user to the new civicrm database you just created. Make sure to give the user full privileges.

3. Go to File Manager and find your way to your drupal/modules folder. That’s where you put your CiviCRM zip/tar file. Unzip the CiviCRM file and you will have your CiviCRM folder right where you need it to be…in the drupals/modules folder.

4. Now for the tricky part. You have to change some coding in the civicrm.settings.php.sample file in the new CiviCRM folder. They have written a ton of “examples” in the script so it’s difficult to see exactly where you have to configure it.

Ignore all the lines that start with an * symbol…they are just instructions. I’ve removed all the examples to make this less confusing. Look for the “define” lines that DON’T start with the * symbol as well as the other lines without that symbol and those are the lines you either must or can configure.

Pay CLOSE attention in defining the database information. The first defines is for your DRUPAL database and the second is for your CIVICRM database. You can put them in the same database if you really want to but I strongly advise against it. If something goes wrong and they are on separate databases then you can remove CiviCRM without breaking your Drupal installation. Use two separate databases and then if they don’t work right together it will be much easier to deal with it.
________________________________________________________________________

<?php

define( 'ENABLE_COMPONENTS', 'CiviContribute,CiviMember,CiviMail' );
define( 'CIVICRM_UF' , 'Drupal' );
define( 'CIVICRM_UF_VERSION' , '4.7' );
define( 'CIVICRM_UF_URLVAR' , 'q' );
define( 'CIVICRM_UF_DSN' , 'mysql://db_user:password@mysqlhost/yourdrupal_db?new_link=true' );
define( 'CIVICRM_UF_USERSTABLENAME', 'users' );
global $civicrm_root;
$civicrm_root = './modules/civicrm';
define( 'CIVICRM_TEMPLATE_COMPILEDIR', './modules/civicrm/templates_c/' );
define( 'CIVICRM_UPLOADDIR' , './modules/civicrm/upload/' );
define( 'CIVICRM_IMAGE_UPLOADDIR' , './modules/civicrm/persist/');
define( 'CIVICRM_CUSTOM_FILE_UPLOADDIR' , '.modules/civicrm/crm_docs/' );
define( 'CIVICRM_UF_BASEURL' , ‘http://your site.com/drupal/' );
define( 'CIVICRM_UF_RESOURCEURL' , 'http://your site.com/drupal/modules/civicrm/' );
define( 'CIVICRM_IMAGE_UPLOADURL' , 'http://www.your site.com/drupal/modulues/civicrm/persist/' );

define( 'CIVICRM_MYSQL_VERSION', 4.1 );
define( 'CIVICRM_DSN' , 'mysql://db_user:password@yourmysqlhost/db_civicrm?new_link=true' );
define( 'CIVICRM_MYSQL_PATH', '/usr/bin/' );
define( 'CIVICRM_SMTP_SERVER' , 'yoursmtpserverhere' );
define( 'CIVICRM_SMTP_PORT' , 25 );
define( 'CIVICRM_SMTP_AUTH' , false );
define( 'CIVICRM_SMTP_USERNAME', 'yoursmtpusernamehere' );
define( 'CIVICRM_SMTP_PASSWORD', 'yoursmtppasswordhere' );
define( 'CIVICRM_COUNTRY_LIMIT' , 'US' );

define( 'CIVICRM_PROVINCE_LIMIT' , 'US' );
define( 'CIVICRM_DEFAULT_CONTACT_COUNTRY', 'US' );
define( 'CIVICONTRIBUTE_DEFAULT_CURRENCY' , 'USD' );
define( 'CIVICRM_LC_MESSAGES' , 'en_US' );
define( 'CIVICRM_ADDRESS_FORMAT' , '
{street_address}
{supplemental_address_1}
{supplemental_address_2}
{city}{, }{state_province}{ }{postal_code}
{country}
' );
define( 'CIVICRM_DATEFORMAT_DATETIME', '%B %E%f, %Y %l:%M %P' );
define( 'CIVICRM_DATEFORMAT_FULL', '%B %E%f, %Y' );
define( 'CIVICRM_DATEFORMAT_PARTIAL', '%B %Y' );
define( 'CIVICRM_DATEFORMAT_YEAR', '%Y' );
define( 'CIVICRM_DATEFORMAT_QF_DATE', '%b %d %Y' );
define( 'CIVICRM_DATEFORMAT_QF_DATETIME', '%b %d %Y, %I : %M %P' );
define( 'CIVICRM_MONEYFORMAT', '%c %a' );
define( 'CIVICRM_LC_MONETARY', 'en_US' );
define('CIVICRM_MAP_PROVIDER' , '' );
define('CIVICRM_MAP_API_KEY' , '' );
define('CIVICRM_MAP_GEOCODING' , 1 );
define('CIVICRM_GEOCODE_METHOD', '' );
define('CIVICRM_VERSION_CHECK', true);
define( 'CIVICRM_CONTRIBUTE_PAYMENT_PROCESSOR' , '' );
define( 'CIVICRM_CONTRIBUTE_PAYMENT_EXPRESS_BUTTON', // API Username
define( 'CIVICRM_CONTRIBUTE_PAYMENT_TEST_USERNAME' , ‘' );
define( 'CIVICRM_CONTRIBUTE_PAYMENT_TEST_KEY' , '' );
define( 'CIVICRM_CONTRIBUTE_PAYMENT_TEST_CERT_PATH' , '');
define( 'CIVICRM_CONTRIBUTE_PAYMENT_PAYPAL_EXPRESS_TEST_URL', 'www.sandbox.paypal.com');
define( 'CIVICRM_CONTRIBUTE_PAYMENT_USERNAME' , 'e' );
define( 'CIVICRM_CONTRIBUTE_PAYMENT_PASSWORD' , '' );
define( 'CIVICRM_CONTRIBUTE_PAYMENT_KEY' , '' );
define( 'CIVICRM_CONTRIBUTE_PAYMENT_CERT_PATH' , '' );
define( 'CIVICRM_CONTRIBUTE_PAYMENT_PAYPAL_EXPRESS_URL', 'www.paypal.com');
define('CIVICRM_ENABLE_SSL', 0 );
define('CIVICRM_DOMAIN_ID' , 1 );
define( 'CIVICRM_MAX_LOCATION_BLOCKS', 2 );
define( 'CIVICRM_CAPTCHA_FONT_PATH', '/usr/X11R6/lib/X11/fonts/' );
define( 'CIVICRM_CAPTCHA_FONT' , 'HelveticaBold.ttf' );
define( 'CIVICRM_DEBUG', 0 );
define( 'CIVICRM_BACKTRACE', 0 );
define( 'CIVICRM_MAILER_SPOOL_PERIOD', 180);
define( 'CIVICRM_VERP_SEPARATOR', '.' );
define( 'CIVICRM_MAILER_BATCH_LIMIT', 0 );
define( 'CIVICRM_SMS_USERNAME' , 'USERNAME' );
define( 'CIVICRM_SMS_AGGREGATOR', 'CRM_SMS_Protocol_Clickatell' );
define( 'CIVICRM_UF_FRONTEND', 0 );
define( 'CIVICRM_FATAL_ERROR_TEMPLATE', 'CRM/error.tpl' );
define( 'CIVICRM_FATAL_ERROR_HANDLER', '');
define( 'CIVICRM_LEGACY_ENCODING', 'Windows-1252' );
*
* Do not change anything below this line. Keep as is
*
>
______________________________________________________________________

5. Edit the files server path using ./drupal/modules/civicrm/WHATEVERCOMESNEXT instead of trying to figure out the exact path, which was just easier and actually works, so just do it.

6. Add 4 folders with write permissions in the CiviCRM folder called upload, crm_docs, template_c and persist.

7. Move the file you just finished editing/configuring to drupal/sites/default folder. Rename it to civicrm.settings.php. Copy the file to your modules/civicrm folder.

8. Use FTP or another method to download two sql files from your drupal/modules/civicrm/sql/ file directory. They are: civicrm_40 or civicrm_41 and civicrm_generated. Which civicrm sql file you use depends on your version of MySQL. If it’s version 4.1 or over you use 41 and anything below you use 40.

10. Go to PHPMyAdmin and select the civicrm database which at this point was still empty. Use "Import" and browse your desktop to find the civicrm_40 or 41 sql file you downloaded there. Don’t change ANY of the fields at all and click the Go/Enter button. Do the same thing with the civicrm_generated sql file.

11. Go to modules admin on your drupal site and enable civicrm and as long as you configured everything properly it should work for you.

There are many other configurations that can be done to the civicrm.settings.php file. I have only covered the ones that worked for me to get CiviCRM installed and functioning properly without errors. I hope this helps make the installation of CiviCRM easier for you than it would be if you had to figure it out on your own.

grvgl’s picture

Thanks. I am still getting below errors. Please see if you can give some tips on these. Thanks.

1.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in C:\Program Files\Apache Group\Apache2\htdocs\d47\modules\civicrm\CRM\Core\BAO\UFGroup.php on line 887.

2.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in C:\Program Files\Apache Group\Apache2\htdocs\d47\modules\civicrm\CRM\Core\BAO\UFGroup.php on line 887.

3.
unrecoverable error
Sorry. A non-recoverable error has occurred.

Database Error Code: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ) ORDER BY name' at line 4, 1064

Return to CiviCRM menu.

4. While trying to run civicrm_generated.mysql below error message was displayed.

#1452 - Cannot add or update a child row: a foreign key constraint fails (`civicrm/civicrm_accept_credit_card`, CONSTRAINT `civicrm_accept_credit_card_ibfk_1` FOREIGN KEY (`domain_id`) REFERENCES `civicrm_domain` (`id`))

Regards,
~Gaurav Goel

Share and Evolve!

ladycentaur’s picture

I had a bunch of errors until I was able to get the civicrm_generated.mysql successfully loaded into the database as well.

Did you change anything other than the paths and urls to your site and the database information? That's all you need to add in order to get it working. All the other stuff I would not touch until after a successful install.

The initial error points to there possibly being a problem with the UF settings (paths) you configured. Did you change those non http:// path settings to '.module/civicrm' and so on? I couldn't get the actual paths to work so I used that method and it worked the first time I tried it.

You also have to add those 4 folders and make sure they are writable and place them at the exact path you configured the civicrm.settings.php file to.

If you tried the method above with files you already had uploaded and editted I would suggest that you start fresh. Hopefully you used a separate database for CiviCRM so you can just delete it and make a new one. You might also want to go back to the zip file and extract a new copy of the civicrm.settings.php.sample file and configure it from scratch in case you accidentally messed something up while configuring it.

Those are the things I would try.

These instructions won't work unless you get both of those mysql files Imported into the database. If you are trying to install on the same database you already installed on there might be a conflict with the new info you're trying to import.

Check the UF settings in the civicrm.settings.php file first, though...and make sure you put a copy of it in drupal/sites/default.

Hope something helps...

ladycentaur’s picture

****Make sure you enter the "UF" database information using your DRUPAL database username:drupaluserpassword@localhost(or your mysql host if different)/DRUPAL database

You have to use both your Drupal DB info as well as the new CiviCRM DB infor in the civicrm.settings.php file.****

define( 'CIVICRM_UF' , 'Drupal' );
define( 'CIVICRM_UF_VERSION' , '4.7' );
define( 'CIVICRM_UF_URLVAR' , 'q' );
define( 'CIVICRM_UF_DSN' , 'mysql://DRUPALdb_username:password@mysqlhost/DRUPAL_db?new_link=true' );
define( 'CIVICRM_UF_USERSTABLENAME', 'users' );

****BELOW: IF your civicrm folder is named civicrm you can copy the paths below EXACTLY for your file! Just add the 4 folders to your civicrm folder: templates_c, upload, crm_docs and persist and you can use the below settings just as they are.****

global $civicrm_root;
$civicrm_root = './modules/civicrm';
define( 'CIVICRM_TEMPLATE_COMPILEDIR', './modules/civicrm/templates_c/' );
define( 'CIVICRM_UPLOADDIR' , './modules/civicrm/upload/' );
define( 'CIVICRM_IMAGE_UPLOADDIR' , './modules/civicrm/persist/');
define( 'CIVICRM_CUSTOM_FILE_UPLOADDIR' , '.modules/civicrm/crm_docs/' );

****BELOW: use the actual URL to your drupal installation, your civicrm folder and the persist folder you made.****

define( 'CIVICRM_UF_BASEURL' , ‘http://your site.com/drupal/' );
define( 'CIVICRM_UF_RESOURCEURL' , 'http://your site.com/drupal/modules/civicrm/' );
define( 'CIVICRM_IMAGE_UPLOADURL' , 'http://www.your site.com/drupal/modulues/civicrm/persist/' );

jarius’s picture

Installing CiviCRM 1.5 onto Drupal 4.7 WITHOUT using Command Line

Is there any changes installing 1.6 onto 5.0?

aszalos’s picture

Thanks for detailed instructions. After four trials I followed your recept and had a succesfull installation. Cheers!