Hi all, wondering if you might be able to give me a hand as am absolutely stumped with regards to this problem.
Having installed the latest production stable of Drupal (7.17) on my server I've encountered DRUPAL_ROOT errors ( Use of undefined constant DRUPAL_ROOT - assumed 'DRUPAL_ROOT') and the entire site has fallen over.
I've tried setting the declaration to the Drupal root directory to no avail and have also completely reinstalled Drupal (database and all) and the error still persists.
I'm currently using the following additional modules: -
Ctools
Views
NiceMenus
Twitter
I really don't know what is causing the issue here and would really appreciate a hand in getting this site up and running.
Website URL is www.unthankbooks.com if you want to see the associated failure messages.
Thanks in advance, M
Comments
Suggestions
The relevant code snippet in index.php looks like this:
define('DRUPAL_ROOT', getcwd());require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
I.e. the constant
DRUPAL_ROOTis supposed to be set to the value returned by the PHP functiongetcwd..
However, you get this message:
Use of undefined constant DRUPAL_ROOTThis means that the PHP
definestatement somehow failed to define the constant..
Here is some things to try:
First, add this to the start of settings.php on your site (after
<?php):error_reporting(-1);$conf['error_level'] = 2;
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
This will report more PHP errors, and mayby tell you why PHP failed to initialize the constant.
Second, bypass PHP for defining this constant, and do it this way instead:
define('DRUPAL_ROOT', '/www/www.unthankbooks.com/htdocs');(Replace
/www/www.unthankbooks.com/htdocswith whatever your Drupal root is.).
Third:
If you're using any type of caching (e.g. PHP Cache, xcache? or optimizer), it may be a good idea to turn it off (No idea why, I just found this here: http://forum.civicrm.org/index.php?topic=23252.0).
Not sure what on earth is
Not sure what on earth is causing it but for some reason the DRUPAL_ROOT definition was renamed in the index.php file to something else entirely... obviously the main reason it failed, strange thing was that when opening the file using notepad it still looked correct, only noticed when I opened it in wordpad by accident.