I solved my problem.
I choose the chpasswd driver. Then, I gave the right to apache to change the user password without enter the sudo password. To do that, I used the command
sudo EDITOR=vim visudo
(You can choose an other editor, like nano)
www-data ALL=NOPASSWD: /usr/sbin/chpasswd
Be extremely careful ! Even is there is a check before applying the changes, it can break your system !