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 »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Drupal Installation
Pages: [1] 2

Author Topic: Drupal Installation  (Read 10531 times)

jefflocke

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
Drupal Installation
June 22, 2009, 12:21:23 pm
Using Drupal 6.12 and CiviCRM 2.2.6. Getting this error after running install...

Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: user (path: ) in /home/mydrupalsite/public_html/sites/all/modules/civicrm/install/index.php on line 23

What have I done wrong? Thanks.


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Drupal Installation
June 22, 2009, 01:14:39 pm
The only instances of that error I can find on this forum are with much older copies of the CiviCRM codebase. Can you insure that you've un-tarred (unpacked) the latest 2.2.6 download.
Protect your investment in CiviCRM by  becoming a Member!

jefflocke

  • I’m new here
  • *
  • Posts: 7
  • Karma: 0
Re: Drupal Installation
June 22, 2009, 01:35:00 pm
I downloaded 2.2.6 today. Fresh install using Acquia Drupal 6.12. Must be an issue with the host.  I installed the same code at another location without issue.


Follow up... the host company instructed me to change the ini_set in settings.php from  ini_set('session.save_handler', 'user');   to    ini_set('session.save_handler', 'files');

which they said normally works.


In my case the required change was to add the ini_set('session.save_handler','files'); to the drupal/civicrm.module file.



« Last Edit: June 23, 2009, 05:15:39 am by jefflocke »

JaneEyre

  • Guest
Re: Drupal Installation
June 29, 2009, 05:15:14 pm
Thanks for sharing your idea here. I appreciate your idea, very excellent ::).

simulationcredit


mariagwyn

  • I post frequently
  • ***
  • Posts: 149
  • Karma: 4
  • CiviCRM version: CiviCRM 3.3.3
  • CMS version: Drupal 6.20
  • MySQL version: 5.2.14
  • PHP version: 5.0.91-50-log
Re: Drupal Installation
July 03, 2009, 08:49:41 pm
I am running into the same error, drupal 6.13, civicrm 2.2.6, just downloaded.  I tried to put "ini_set('session.save_handler','files')" in the civicrm.module, but this didn't work.  Is there somewhere in particular it should be placed?

newbie27

  • Guest
Re: Drupal Installation
August 05, 2009, 01:59:03 pm
Hi:

I am having exactly this same problem while trying to install CiviCRM 2.2.8 onto my Drupal website. I was able to successfully install it to my local machine but when I tried to install it to my production server it gave me the exact same error as described by jefflocke.

I looked at the file drupal/civicrm.module but it is not at all obvious where to insert the ini_set command referred to by Jeff.
I can see in the settings.php file (living in the sites/default folder) where the ini_set commands are. However I am reluctant to just change them, as they are not part of the Civicom code base but part of the Drupal website code. I am unclear why we need to be fiddling with that.

Any suggestions?

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Drupal Installation
August 12, 2009, 04:58:22 am
In general, PHP settings are best set outside the PHP scripts, so the *right* place for this would be a .htaccess file in the root of the website with

Code: [Select]
php_value session.save_handler files

or a php.ini file with

Code: [Select]
session.save_handler = files

(contact your hosting provider to check which would work in your case).

If you do need to try to set it from PHP, put the ini_set() call in drupal/civicrm.module file’s civicrm_invoke() function (i.e., around the 300th line of the file).
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

DaisyK

  • Guest
Re: Drupal Installation
October 26, 2009, 09:16:50 am
Same problem installing CiviCRM 3.0 on Drupal 6.14. Resolution on HotDrupal.com hosting:

Edit the install/index.php file and also the civicrm.config.php and add:

ini_set("session.save_handler","files");

after the opening php lines.

No te to CiviCRM staff:Perhaps this should be part of the official setup.


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Drupal Installation
October 26, 2009, 09:47:45 am
Quote from: DaisyK on October 26, 2009, 09:16:50 am
Same problem installing CiviCRM 3.0 on Drupal 6.14. Resolution on HotDrupal.com hosting:

Edit the install/index.php file and also the civicrm.config.php and add:

ini_set("session.save_handler","files");

after the opening php lines.

No te to CiviCRM staff:Perhaps this should be part of the official setup.

I think this modification requirement is host / server specific - so I've added the error message and some info to the Trouble-shooting doc on the wiki:
http://wiki.civicrm.org/confluence/display/CRMDOC/Installation+and+Configuration+Trouble-shooting
Protect your investment in CiviCRM by  becoming a Member!

pdowling

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 4
Re: Drupal Installation
November 01, 2009, 10:47:25 pm
Just stumbled upon this thread.  Haven't had a chance to fix yet, will report back when I do.

However, in the meantime I'm also a hotdrupal hosting user.  I was able to recent upgrade to the latest civi no problem.  I didn't get the above error till trying to send a civimail mailer (I hadn't been using the civimail functionality up to now so pretty new to that).

Anyway, test mails work, but the real mails don't.  When trying to visit the URL to trigger the mail cron job I was getting.

Code: [Select]
Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: user (path: ) in /home/user/public_html/sites/all/modules/civicrm/bin/civimail.cronjob.php on line 43
I checked the php.ini and I've got the following registered save handlers (files user sqlite).

A bit of fishing around on the drupal.org site suggests that drupal uses "user" save handlers, but that it is explicitly set in the settings.php page with an ini_set so it won't matter what is in php.ini.

Anyway, just adding to this thread in case an appropriate code update can prevent this in the future.  For example, would explicitly setting save handler to "file" in the civi settings php avoid users from having this problem regardless of host?

I'll report back after testing.

pdowling

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 4
Re: Drupal Installation
November 01, 2009, 10:56:38 pm
OK, so I tried the above hot drupal fix and now on every page in drupal I get a red error box as follows:

Code: [Select]
warning: ini_set() [function.ini-set]: A session is active. You cannot change the session module's ini settings at this time in /home/winstonp/public_html/livesites/sites/stamfordrobotics.org/civicrm.settings.php on line 181.
Dead tired so not sure if the fix doesn't work or I didn't do something right, but in case this helps anyone else.

pdowling

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 4
Re: Drupal Installation
November 01, 2009, 11:00:19 pm
OK, so realized I'm editing the wrong file.  Opened the civicrm.config.php, but not clear where I would put the ini_set in this file.  Can anyone help with that?

pdowling

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 4
Re: Drupal Installation
November 01, 2009, 11:09:18 pm
OK, last post for tonight.  I put the ini_set in the correct place (I think).

Not getting the red error box in drupal now, but didn't fix the problem with the cron mailer script either.

So this...

Code: [Select]
http://example.com/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=username&pass=password&key=sitekey
...continues to generate this error:

Code: [Select]
Fatal error: session_start() [<a href='function.session-start'>function.session-start</a>]: Failed to initialize storage module: user (path: ) in /home/user/public_html/sites/all/modules/civicrm/bin/civimail.cronjob.php on line 43
Any suggestions?

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Drupal Installation
November 02, 2009, 12:41:00 am
Quote from: pdowling on November 01, 2009, 11:09:18 pm
OK, last post for tonight.  I put the ini_set in the correct place (I think).

[…]

Code: [Select]
Failed to initialize storage module: user

If it says that it failed to initialize the ‘user’ storage module, then it does not use the ‘files’ session handler (as per ini_set('session.save_handler', 'files') it should), so it looks like your ini_set() call is ignored. The best way would be to contact your hosting on where you can put the ini_set() call (or the other ways to set the variable that I mentioned above).
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

pdowling

  • I post occasionally
  • **
  • Posts: 70
  • Karma: 4
Re: Drupal Installation
November 03, 2009, 09:21:52 pm
Thanks Piotr,

After researching a bit on the php.net site around what savehandler is, session_start etc. I decided to give it one more try by putting the ini_set directly before the session_start() statement in the run() function in civimail.cronjob.php (in the bin folder).

That seems to have done the trick for the cron job sending the mail.

Had to do the same thing in CiviMailProcessor.php to get the return path processing to not generate that error.

Tested by running these paths in the browser address....

http://mysite.org/sites/all/modules/civicrm/bin/civimail.cronjob.php?name=username&pass=password&key=mykey
http://mysite.org/sites/all/modules/civicrm/bin/CiviMailProcessor.php?name=username&pass=password&key=mykey

which no longer generate the errors.

By the way, question for the coders.  Why would either of the above php scripts need session_start at all?  Aren't sessions mostly to carry data from one http request to the next?  Do these scripts have a dependency on information being held in the session from one cron run to the next?

Reason I ask is I was wondering why session_start is even in these scripts?

Just for kicks I commented session_start out from civimail.cronjob.php, then sent a new mailer.  Ran civimail.cronjob.php as per above.  Mail went out fine and as normal as far as I can tell.  If I left session_start would something mysteriously break down the line (for example with a large mailing or some such)?

I mean if we don't need a session_start, isn't it a bug (albeit a subtle one) to have it in there?

Thanks...

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • Drupal Installation

This forum was archived on 2017-11-26.