Is this the right entry for the sudoers file to give php access to reload nginx?

StackOverflow https://stackoverflow.com/questions/8600941

  •  24-03-2021
  •  | 
  •  

문제

I need to give php access to reload nginx. The command is nginx -s reload so is the entry in the sudoers file below correct?

www-data ALL=NOPASSWD: nginx -s reload

Then would <?php exec('sudo nginx -s reload'); ?> or shell_exec be the function to use?

Thanks

도움이 되었습니까?

해결책

I would use the absolute path to nginx, but your syntax looks correct. You would use shell_exec()

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top