nginx + php-fpm で、PHPでファイル作成とかするとユーザー(とグループ)が nginx になってしまうので、バーチャルホストごとに違うユーザーで動かしたく、それを解消するメモ。 まだこの構成に慣れていないので変なところがあるかも・・・ php-fpm の設定 ユーザー用のプロセスを作るため、 設定ファイルにユーザー(例として「 myname 」)用の記述を追加 [myname] listen = /var/run/php-fpm-myname.sock listen.mode = 0666 user = myname group = myname pm.max_children = 3 pm.start_servers = 3 $ service php-fpm restart $ ps aux | grep '^myname' myname 21282 0.0 0.5 2