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) »
  • PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.p
Pages: [1]

Author Topic: PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.p  (Read 14612 times)

welly

  • I’m new here
  • *
  • Posts: 29
  • Karma: 2
  • CiviCRM version: 4.4
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.p
February 20, 2014, 09:28:16 am
Hello all,

I've had this problem occur before and it's happened again. It's come out of nowhere and the only resolution is to move the civicrm folder out of sites/all/modules.

-----

mod_fcgid: stderr: PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.php' (include_path='.:/var/www/vhosts/example.com/sites/all/modules/civicrm:/var/www/vhosts/example.com/sites/all/modules/civicrm/packages:.:') in /var/www/vhosts/example.com/sites/default/civicrm.settings.php on line 304, referer: http://example.com/admin/structure/views

-----

When it's occurred before, I've unextracted a new copy of Civi into the folder and it's 5 times out of 10 fixed it. I did that this time and it failed. I can absolutely confirm the file that Civi appears not to be able to find does exist in both the locations listed in the include_path so I can't see how that is the problem.

Any help is very gratefully received! The Civi version is 4.3.5 and the Drupal version is 7.

Thanks,

welly

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.p
February 20, 2014, 01:29:57 pm
I don't know if there is any downside but we have actually removed those lines from civicrm.settings.php with some success. In 4.4.x there is a gotcha where you might need to clear a variable (I think there is a ticket on that).

NB - didn't see you at DrupalSouth
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

welly

  • I’m new here
  • *
  • Posts: 29
  • Karma: 2
  • CiviCRM version: 4.4
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
Re: PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.p
February 21, 2014, 02:16:10 am
Quote from: Eileen on February 20, 2014, 01:29:57 pm
I don't know if there is any downside but we have actually removed those lines from civicrm.settings.php with some success. In 4.4.x there is a gotcha where you might need to clear a variable (I think there is a ticket on that).

NB - didn't see you at DrupalSouth

I might try that! No.. didn't make it to DrupalSouth this year - I'm currently back in Pommyland. Next year though..

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.p
February 21, 2014, 04:24:20 am
Yeah I've been pulling those two lines out of civicrm.settings.php whenever I hit that error. I'm unsure when that change came in.

There is also a Drupal variable which may need clearing if you've moved the CiviCRM codebase - I forget the name but you can see the stored path with
Code: [Select]
drush vget civicrm (shows all variables matching civicrm) then remove it with
Code: [Select]
drush vdel civicrm_whatever_its_called.
@xurizaemon ● www.fuzion.co.nz

welly

  • I’m new here
  • *
  • Posts: 29
  • Karma: 2
  • CiviCRM version: 4.4
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
Re: PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.p
February 21, 2014, 08:06:28 am
Assuming you're referring to removing:

require_once 'CRM/Core/ClassLoader.php';
CRM_Core_ClassLoader::singleton()->register();

in civicrm.settings.php, I've done this and it's really not made any difference. In fact, the problem is even worse now.

Could not locate CiviCRM codebase. Make sure CiviCRM settings file has correct information.                                  [error]
include_once(CRM/Core/Config.php): failed to open stream: No such file or directory civicrm.module:251                       [warning]
include_once(): Failed opening 'CRM/Core/Config.php' for inclusion                                                           [warning]
(include_path='.:/var/www/vhosts/example.com/sites/all/modules/civicrm:/var/www/example.com/sites/all/modules/civicrm/packages:.:')
civicrm.module:251
Invalid argument supplied for foreach() block.module:389                                                                     [warning]
Invalid argument supplied for foreach() block.module:389                                                                     [warning]
Invalid argument supplied for foreach() block.module:389                                                                     [warning]
'all' cache was cleared in /var/www/vhosts/example.com#default                                        [success]
Oops! - The path for including CiviCRM code files is not set properly. Most likely there is an error in the civicrm_root     [status]
setting in your CiviCRM settings file (sites/default/civicrm.settings.php). » civicrm_root is currently set to: .Please
review the Drupal Installation Guide and the Trouble-shooting page for assistance. If you still need help installing, you can
often find solutions to your issue by searching for the error message in the installation support section of the community
forum.

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.p
February 22, 2014, 08:19:35 am
I've seen this error when I've moved a site and not adjusted civicrm.settings.php - could that be your case?
Lead Developer, C3 Design.
Twitter: @FatherShawn

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.p
February 23, 2014, 03:56:25 pm
Quote
Could not locate CiviCRM codebase. Make sure CiviCRM settings file has correct information.   

implies the global $civicrm_root is not correctly set
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

welly

  • I’m new here
  • *
  • Posts: 29
  • Karma: 2
  • CiviCRM version: 4.4
  • CMS version: Drupal
  • MySQL version: 5.1
  • PHP version: 5.3
Re: PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.p
February 24, 2014, 03:52:20 am
Quote from: FatherShawn on February 22, 2014, 08:19:35 am
I've seen this error when I've moved a site and not adjusted civicrm.settings.php - could that be your case?

Quote from: Eileen on February 22, 2014, 08:19:35 am
implies the global $civicrm_root is not correctly set

I'm glad you both got me to look again for a third or fourth time at the civicrm.settings.php file. $civicrm_root was incorrect. Sorry :)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.p
February 24, 2014, 11:39:04 am
It happens :-)
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • Drupal Installations (Moderator: Piotr Szotkowski) »
  • PHP Fatal error: require_once(): Failed opening required 'CRM/Core/ClassLoader.p

This forum was archived on 2017-11-26.