function hook_install


Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/
cis7 system.api.php hook_install()
cle7 system.api.php hook_install()
elmsmedia7 system.api.php hook_install()
icor7 system.api.php hook_install()
meedjum_blog7 system.api.php hook_install()
mooc7 system.api.php hook_install()

Perform setup tasks when the module is installed.

If the module implements hook_schema(), the database tables will be created before this hook is fired.

Implementations of this hook are by convention declared in the module's .install file. The implementation can rely on the .module file being loaded. The hook will only be called the first time a module is enabled or after it is re-enabled after being uninstalled. The module's schema version will be set to the module's greatest numbered update hook. Because of this, any time a hook_update_N() is added to the module, this function needs to be updated to reflect the current version of the database schema.

See the Schema API documentation for details on hook_schema and how database tables are defined.

Note that since this function is called from a full bootstrap, all functions (including those in modules enabled by the current page request) are available when this hook is called. Use cases could be displaying a user message, or calling a module function necessary for initial setup, etc.

Please be sure that anything added or modified in this function that can be removed during uninstall should be removed with hook_uninstall().

See also







Related topics

107 functions implement hook_install()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

accessibility_install in sites/all/modules/ulmus/accessibility/accessibility.install
Implements hook_install().
actions_loop_test_install in modules/simpletest/tests/actions_loop_test.install
Implements hook_install().
admin_menu_install in sites/all/modules/ulmus/admin_menu/admin_menu.install
Implements hook_install().
admin_menu_toolbar_install in sites/all/modules/ulmus/admin_menu/admin_menu_toolbar/admin_menu_toolbar.install
Implements hook_install().
admin_theme_install in sites/all/modules/ulmus/admin_theme/admin_theme.install
Implementation of hook_install().

... See full list

3 invocations of hook_install()
drupal_check_module in includes/
Checks a module's requirements.
drupal_install_system in includes/
Installs the system module.
module_enable in includes/
Enables or installs a given list of modules.


modules/system/system.api.php, line 3310
Hooks provided by Drupal core and the System module.


function hook_install() {
  // Populate the default {node_access} record.
    'nid' => 0,
    'gid' => 0,
    'realm' => 'all',
    'grant_view' => 1,
    'grant_update' => 0,
    'grant_delete' => 0,



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/ in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/
The website encountered an unexpected error. Please try again later.