Skip to content

Instantly share code, notes, and snippets.

@bes1002t
Last active January 3, 2018 12:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bes1002t/7c47715ab9938a96e3f65e54e8669e29 to your computer and use it in GitHub Desktop.
Save bes1002t/7c47715ab9938a96e3f65e54e8669e29 to your computer and use it in GitHub Desktop.
Start php-fpm as non root user when using phpenv
[Unit]
Description=Phpenv created Php-Fpm fastcgi
Documentation=man:php-fpm(8)
After=nginx.target
[Service]
Type=forking
RuntimeDirectory=php-fpm
ExecStart=/home/nginx/.phpenv/shims/php-fpm
ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /var/run/php-fpm/php-fpm.pid
TimeoutStopSec=5
KillMode=mixed
User=nginx
Group=nginx
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment