You can't easily do this without either:
- Writing or creating something which will change user ID to root
OR
- Running Apache and PHP as root
The latter might be acceptable if your site is very tightly locked down (You won't want any non-root users to be able to create web pages in this server, nor will you want to run any other web app on the same one).
The easiest way to do it ass non-root is to create a program to create the user and set the password etc (e.g. in C, shell script or sommething), then using "sudo", grant the web user access to execute this program as root.
Of course you need an adequate mechanism of preventing other (e.g. shell, PHP) users on the same machine abusing this system. Running the whole lot as a different UID (including Apache) that they have no access to is recommended.
Mark