How to create user "nginx"?

Im just installed nginx from source

but when run /etc/init.d/php_cgi start, there is a message:
Starting php-cgi: spawn-fcgi: can't find user name nginx

...one more I dont know about their permission.

previously I install nginx using yum (CentOS)


This will create the user and set their shell to /bin/false so no one can start an interactive login as this user.

$ useradd -s /bin/false nginx

Try

$ sudo adduser --system --no-create-home --user-group --disabled-login --disabled-password nginx

Or

$ sudo adduser --system --no-create-home --user-group -s /sbin/nologin nginx

On Ubuntu you can use this command:

adduser --system --no-create-home --shell /bin/false --group --disabled-login nginx