I want create a simple PHP form (nickname and username) to allow users register a new jabber account in the server through the website. I'm using prosody as XMPP server and I can create new accounts through clients such Pidgin, etc but although I was reading about it, I found that to use XMPP over http I should enable a bosh server but I don't know if it can help me to find a solution for my problem and the few libraries which I found of XMPP in PHP haven't any function to create new accounts in the server (or unless I didn't see any function...). And I don't want use the exec function due to that the command to register new users ask me for sudo privileges. If someone can teach me about how deal with it to learn I will be very grateful.
Although your question could have been put better, one solution would seem to be running the prosody server with a non-root account (which is probably a good idea anyway). Either with www-data or another user/group that would allow the www-data user to have enough privileges. Then PHP exec shouldn't have a problem.
Also, there used to be a module for prosody that allowed control via XMLRPC. The docs show it has been deprecated in current versions, but maybe it's still in the source? If that module is still available to use then you could use XMLRPC to speak to the prosody server from PHP.