2017-02-09 62 views
1

所以我想在我的CentOS 7 Apache服務器上設置FileRun,但這是說PHP沒有任何寫入權限。我嘗試過使用chownchmod(都與sudo),但沒有任何區別。我發現錯誤日誌,重複我剛剛說的,如果你需要它:PHP無法寫入Web服務器,即使使用chown

[08-Feb-2017 19:35:50歐洲/倫敦] PHP警告:file_put_contents(/ var/www/html/system/data/temp/cache.translation.english.tmp.php):未能打開流:/var/www/html/system/classes/vendor/FileRun/Utils/Cache.php上的權限被拒絕第17行

其他我可以試試嗎?

編輯:我被要求包括ls -ltr的輸出,所以在這裏你去。這就是我得到的。

directory listing

(對不起,提供它作爲一個圖像,而是將其粘貼文本將意味着我必須正確格式化。)

+0

你傳遞給'chown'和'chmod'什麼參數,打開瀏覽器? – Kisaragi

+0

@Kisaragi我用'sudo chown apache:apache -R/var/www/html'和'sudo chmod 0775 -R/var/www/html'。 – Permanently

+2

嘗試'sudo chown -R apache/var/www/html'和'sudo chmod -R 755/var/www/html' – Kisaragi

回答

2

請嘗試:

喬敦 - R的阿帕奇:阿帕奇的/ var/www/html等/

semanage的fcontext -a -t httpd_sys_rw_content_t'data'

然後

setsebool -P httpd_unified 1

重啓httpd和PHP-fpm的守護進程。

systemctl restart httpd; systemctl重新啓動的php-fpm的

http://your_ip_server

0

我不能張貼在這裏發表評論,但嘗試

chown -R apache:apache /var/www/html 

而且這是什麼名單,如果你說

ls -l /var/www 

的d

ls -l /var/www/html 

而且該文件的所有者或文件的組所有者,必須是/包含誰被列爲您的網站內容擁有者相同的用戶。在這種情況下,特別是var/www/html/system/classes/vendor/FileRun/Utils/Cache.php

+0

我試過'chown'命令,但是沒做任何改變。至於'ls -l',目錄有drwxrwxr-x,文件有-rwxrwxr-x。 – Permanently

相關問題