I've installed civicrm on drupal site (on remote virtual hosting). And I need to create an extension for civicrm. As far as I know, civix is required for that. I've read https://github.com/totten/civix/ but can't install civix. I've downloaded archive, extracted it and put to /sites/default/files/civicrm folder and it doesn't work. So where I have to place civix? Something else is reqired? Some executables or any other things?

And the next question: how to generate module extension using that civix? I've read https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Generateaskeletalextension - there are some things that I can't understand, for example "/var/www/extensions" - I have no such path in my civicrm.

2 Answers 2


The main civix download is a PHAR archive. You can generally execute a PHAR archive directly, without extracting it, as described in the README:

sudo curl -LsS https://download.civicrm.org/civix/civix.phar -o /usr/local/bin/civix
sudo chmod +x /usr/local/bin/civix

If it's a typical Debian/Ubuntu/RedHat server which you fully control, then putting the file in /usr/local/bin/ is handy. However, this is not required: as far as civix is concerned, you can put the file in any folder with any owner. For convenience, add the folder to the PATH.

Note: Some server admins/distros set up their own funky rules (e.g. via mount options or apparmor or disabling PHP extensions whatever) -- this is especially true on shared hosting. Unfortunately, only you and your admin can determine these types of things.

  • I don't have access to /usr/local/bin/ - it's a virtual hosting. Any other ideas? Commented Oct 13, 2016 at 11:06
  • As far as civix is concerned, you can put the file in any folder with any owner. For convenience, add the folder to the PATH.
    – Tim Otten
    Commented Oct 13, 2016 at 17:46

Sounds like you need to re-read the instructions. On a whim, I'd guess that you don't actually need to write an extension, but if you are sure you do, you'll want to do it on a development machine, not your production machine, especially since you'll need command-line access. Your extensions directory is where you choose to create it, it won't be there automagically.

  • I have SSH access to my hosting, but I don't know where to put civix (or how to install it there). Any suggestions? Commented Oct 12, 2016 at 4:33
  • 1
    Tim's gone ahead and pasted in the relevant bit from the readme, but I'd re-iterate my first comment that you should start by reading the instructions, they are very straightforward, or ask questions about the bits you don't understand. You're also ignoring my advice that you shouldn't be doing this on your production machine.
    – Alan Dixon
    Commented Oct 12, 2016 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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