I'm trying to generate a new extension module following instructions from the docs: https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-module However, when I run the proposed command to generate the skeletal extension

$ civix generate:module "com.example.myextension" --license=AGPL-3.0

I get the following:

Initalize module com.example.myextension
Write com.example.myextension/info.xml
Write com.example.myextension/myextension.php
Write com.example.myextension/myextension.civix.php
Write com.example.myextension/LICENSE.txt
Write com.example.myextension/README.md
Write com.example.myextension/images/screenshot.png

Refresh extension list for "http://localhost/compucorp/"
Enable extension (com.example.myextension) in "http://localhost/compucorp/"? [Y/n] Y
Enable extension (com.example.myextension) in "http://localhost/compucorp/"
Install error: Unknown extension: com.example.myextension

The extensions directory is created on the root of the CMS (Drupal), and the new extension directory com.example.myextension is created successfully and seems to have right permissions. What can be the problem?

I tried refreshing extensions list from the user interface of CiviCRM and the newly created extension does not appear on the list.


  • Did you "Follow the installation instructions in the GitHub repository"? Did you follow the Pre-Requisites (docs.civicrm.org/dev/en/latest/extensions/#pre-requisites)? Your extensions should be in the CiviCRM extensions directory in Drupal. It would help to post the steps you followed and what you tried, as we have no way of knowing what went went wrong without knowing what steps you followed. – Christia Nov 18 '17 at 7:31

You should run civix generate:module "com.example.myextension in directory where all the other CiviCRM modules reside - /your_drupal_project_root/sites/all/modules/civicrm/ext for Drupal 7 + CiviCRM 4.7. After that do cd com.example.myextension and there generate all the pages, menus etc for your extension. In other CMSes the full path may vary, but anyway it must be civicrm/ext.


Check the Extensions Directory specified at Administer > System Settings > Directories. Your extension needs to be in that directory. If not, either move your code or change the setting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.