You shouldn't need to run Apache as root to do this as my webmin install can do it fine and Apache is not running as root on my machine.
The best way round it is probably to download and have a look at the way webmin (www.webmin.com
) implements adding a new user. You should be able to su and then add the user using either the exec command in php iteself or using it to run a bash script to create the user.
To run exec though you should will need to make sure that PHP is not running in safe mode, You should be able to turn it off by editing the line in the php.ini file from 'safe_mode = On' to 'safe_mode = Off' and restarting the server.
As Cedrik said though, I wouldn't allow the server access from the internet.