Create ejabberd user from PHP

ejabberd, php, xmpp

Solution

ejabberdctl is by far the easiest in this specific case. The other options are:

Implement a full client XMPP in PHP (!)

Implement a module in Erlang that proxies the requests: the PHP<-->Erlang communication would need to be through a socket and lots of marshaling would be involved (!)

Problem

I need to create an ejabberd user from a PHP script. I also need to be able to add the new user to a predefined shared roster. Should I just call `ejabberdctl` using `exec()` or is there a better way?

Original source