0

I have a Drupal installation but no functioning website. How do I find what version of Drupal is installed through the command line?

I cannot login to the site, so the answers here: How to find version of Drupal installed do not help. I am limited to using the command line with access to the file system.

Community
  • 1
  • 1
JonahHuron
  • 297
  • 1
  • 2
  • 12

1 Answers1

0

If you have Drush installed, you can use drush status and it will print out the Drush version and the Drupal version you have installed.

If not, go into your Drupal root directory and take a look at the CHANGELOG.txt file. It will list the most recent upgrade (the current version) at the top.

Edit

If you do not have the CHANGELOG.txt file, and don't have Drush, you can look in the includes/bootstrap.inc file, as suggested in the third answer to the question you linked to.

This is defined as a global PHP variable in /includes/bootstrap.inc within D7. Example: define('VERSION', '7.14'); So use it like this...

if (VERSION >= 7.1) { do_something(); }

loganfarr
  • 581
  • 2
  • 4
  • 11
  • Thank you for answering! Unfortunately, I do not have Drush installed, and `CHANGELOG.txt` has been removed. Both of these were suggested in the thread I linked to. I was hoping for a simpler answer, I suppose. – JonahHuron Mar 08 '16 at 16:24
  • @JonahHuron I changed my answer to add another way to find it. :) – loganfarr Mar 08 '16 at 16:39
  • That ought to work. We've shut down the machine now, so I can't try it, but as I recall, I couldn't find that file. `find` seemed to hang every time I tried it, and it wasn't in any obvious place (obvious to me, at least). I'll mark this as "answered," but if you could suggest a default absolute path to `bootstrap.inc`, it would probably help others in my situation. Thanks again! – JonahHuron Mar 08 '16 at 17:05
  • The path I gave was relative to the Drupal root. Unfortunately I cannot suggest an absolute path relative to the machine because everyone's setup is different, but the path is "absolute" from the Drupal root. – loganfarr Mar 08 '16 at 17:07