目标UID(99)和文件的UID(XX)之间不匹配

我是一个服务器noob。

我只是运行使用Nobody作为进程的所有者的httpd服务器。 我的PHP文件chmod755 ,所有权为Apache:Apache

它触发Mismatch between target UID (99) and UID (XX) of file "/usr/local/apache/htdocs/index2.php"错误Mismatch between target UID (99) and UID (XX) of file "/usr/local/apache/htdocs/index2.php"

我认为我必须

  • 将我的PHP脚本的所有者(或组?)更改为Nobody或
  • 使httpd运行其进程为Apache (为此我找不到/etc/httpd/envvars
  • 完全是另一回事?

请指教。

通常的方法是以用户wwww-data(或web或www,取决于分布)运行Apache,并且可能是用户Apache,因此我将使用第二个选项。

你使用什么分布? 除envvars方法之外,您也可以在Apache的configuration文件中指定用户 。