Whatever user your webserver is running as (usually nobody or httpd) needs permission to write to htdics in order to create a directory there.
As root, or someone with ownership on the /www/htdocs dir, you should do the following:
(this assumes httpd runs your web server, which I highly recommend.)
cd /www
chown httpd.httpd htdocs
chmod 775 htdocs
OR
chmod 6775 htdocs
(the 6 in the 6775 ensures that everything written in that directory by anybody belongs to the httpd group. It's a nice option for making sure the web server owns all the files and directories created therein.)