我一直在試圖設置它,但我被堆疊。我不知道如何設置/ etc/hosts可寫入php,但不是用戶。如何使/ etc/hosts可寫入php而不是用戶
如果我設置了chmod 060 /etc/hosts
和chown www-data:www-data /etc/hosts
,那麼php無法寫入(我假設php的組是www-data)。如果我設置chmod 660 /etc/hosts
它爲PHP工作,但也爲用戶。
這可能嗎?
編輯: 我發現我的用戶是WWW的數據組,所以這是爲什麼應用上460/etc/hosts中沒有工作
什麼是「用戶」是什麼意思?哪個用戶? –
PHP是否真的與該uid/gid一起運行?還要保持主機文件對其他人可讀。 – mario