How can I know which version of Drupal is installed in my server?
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();
}
Alternatively you can install Drupal version check plugin in your browser and click on the drupal icon in your navigation bar. This is the easiest way to check Drupal version.
Here is the link to the plugin - https://addons.mozilla.org/en-US/firefox/addon/drupal-version-check/
For Drupal7
Two ways you can find installed drupal version.for this you have to logged in as admin.
1.Go to Url 'admin/reports/status',on status report page it will show first drupal with its version.
2.Go to Url 'admin/modules',on finding core tab ,we can find drupal contributed modules with 'version'.
For Drupal8
Open drupal\core\lib\Drupal.php in your text editor
you will see something like this (from line 79 to line 84)
open drupal\core\lib\Drupal.php in your text editor
you will see something like this (from line 79 to line 84)
class Drupal {
/**
* The current system version.
*/
const VERSION = '8.2.3';
In Drupal 7
Open CHANGELOG.txt and the top most version will be the installed version.
In Drupal 8
Open core/lib/Drupal.php file and there will be a version mentioned like const VERSION = '8.1.8';
Drush Tool
Drush status
Admin Interface
Go to Administer -> Reports -> Status Report or enter URL /admin/reports/status
Above is the simplest way otherwise installed wappalyzer browser addons and see the magic.
From the database
Run the following query:
SELECT info FROM system WHERE type = 'module' AND name = 'node';
After, you will receive a serialized string value like:
a:10:{s:4:"name";s:4:"Node";s:11:"description";s:66:"Allows content to be submitted to the site and displayed on pages.";s:7:"package";s:15:"Core - required";s:7:"version";s:4:"6.20";s:4:"core";s:3:"6.x";s:7:"project";s:6:"drupal";s:9:"datestamp";s:10:"1292447788";s:12:"dependencies";a:0:{}s:10:"dependents";a:0:{}s:3:"php";s:5:"4.3.5";}
Then, unserialize this string. You can use the php unserialize function or any online web service such as: http://unserialize.me
You should see two array elements as below which shows the current version number:
[version] => 6.20
[core] => 6.x
For older versions you can find the details here: modules/system/system.module
One of my installs says:
define('VERSION', '5.6');