Troubleshooting of PHP errors: Difference between revisions

Jump to navigation Jump to search
Line 14: Line 14:
* 設定該檔案/目錄是否可以寫入: 如果要刪除或寫入檔案,需要檢查是否具備寫入權限
* 設定該檔案/目錄是否可以寫入: 如果要刪除或寫入檔案,需要檢查是否具備寫入權限
*# SELinux (Security-Enhanced Linux) policy: {{kbd | key = httpd_sys_rw_content_t}}<ref>[https://blog.lysender.com/2015/07/centos-7-selinux-php-apache-cannot-writeaccess-file-no-matter-what/ CentOS 7 + SELinux + PHP + Apache – cannot write/access file no matter what | Lysender's Daily Log Book]</ref>
*# SELinux (Security-Enhanced Linux) policy: {{kbd | key = httpd_sys_rw_content_t}}<ref>[https://blog.lysender.com/2015/07/centos-7-selinux-php-apache-cannot-writeaccess-file-no-matter-what/ CentOS 7 + SELinux + PHP + Apache – cannot write/access file no matter what | Lysender's Daily Log Book]</ref>
*# (optional) 該檔案/目錄的 (1) 擁有者是網站使用者 (e.g. 網站伺服器設定檔預設值 CentOS apache、Ubuntu 則是 www-data<ref>[https://ubuntuforums.org/showthread.php?t=1293508 [SOLVED] How to find out Apache Username?]</ref>) 、或者是 (2) 網站使用者的群組 (e.g. CentOS 是 apache) 可以寫入
*# (optional) 該檔案/目錄的 (1) 擁有者是網站使用者 (e.g. 網站伺服器設定檔預設值 CentOS 的 Apache 伺服器是 apache、Ubuntu 的 Apache 伺服器則是 www-data<ref>[https://ubuntuforums.org/showthread.php?t=1293508 [SOLVED] How to find out Apache Username?]</ref>) 、或者是 (2) 網站使用者的群組 (e.g. CentOS 的 Apache 伺服器是 apache、Nginx 伺服器是 nginx) 可以寫入
*# {{Win}} [http://www.webdeveloper.com/forum/showthread.php?165933-File-Permissions-in-Windows-(WAMP) File Permissions in Windows (WAMP)] <ref>[https://technet.microsoft.com/en-us/library/Cc754344.aspx Set, View, Change, or Remove Permissions on Files and Folders]</ref>
*# {{Win}} [http://www.webdeveloper.com/forum/showthread.php?165933-File-Permissions-in-Windows-(WAMP) File Permissions in Windows (WAMP)] <ref>[https://technet.microsoft.com/en-us/library/Cc754344.aspx Set, View, Change, or Remove Permissions on Files and Folders]</ref>


Navigation menu