I want to develop a very simple Extension which :

  • searches the current contact_id
  • then verifies if he is recorded for a given event (event_id as a parameter)
  • then, depending on the result, echoes a message or opens an URL.

I read that, to develop an extension, I first had to :

  • install Civix,
  • which requires installing first git and composer ... which seems very complicated to me for such a simple program.

Is there a way to write and upload directly the code in the Extension directory, whithout all these prerequisites ?


git and composer aren't necessary to install civix. In the README it suggests multiple ways to install civix. The first one is a simple download: https://download.civicrm.org/civix/civix.phar.

  • Thank you Jon. I have just installed (uploaded) civix.phar in my www/www directory, but when I want to run civix civicrm:ping (from www/www$, using PuTTY), I get civix : command not found. Did I forget something ? Sep 13 '19 at 9:42
  • If you're using the .phar file and renamed it to civix then you either need to call php civix ... or use ./civix or update your $PATH environment variable to include the full path to where you have downloaded civix.
    – Demerit
    Sep 13 '19 at 12:49
  • Excuse-me, Demerit, but I am a bit lost (I am not a linux expert). I did not rename civix.phar (should I ?). I run my civix command from home/myhostname/www/www (which is the directory where I downloaded civix.phar). If I run php civix ... I get the following message : failed loading /usr/local/ioncube/ioncuble/ioncube_lin.1.so ... . If I run ./civix ..., I get the following message : ./civix : no such file or directory.(which is different from "command not found") Sep 13 '19 at 13:55
  • Ok I assumed you renamed it. I answered your other post. The ioncube might be the version of command line php installed is mismatched so might need to type php72 instead of php.
    – Demerit
    Sep 13 '19 at 16:16
  • Ioncube is a sort of "copy protection" for commercial PHP programs. I'm guessing this isn't your local computer, but rather a web host - who probably misconfigured their command line so it looks for Ioncube in a place it can't find it. That's an issue to deal with your webhost about. Sep 14 '19 at 2:18

Yes, you could also just create a folder with the name of your extension in the extension folder of CiviCRM, and code from there. But that requires you to understand the folder and file structure required for extensions so it will actually be easier with civix. It is not a prerequisite but it helps a lot!

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.