Fix Failed to Write to Disk | Write Permission Denied Error

Files and Folders Permissions are very essential steps when it comes to hosting your Wordpress, Drupal or any Script online on your server. Permissions allow server computer to read, write and edit your files/folders. Simultaneously, some file’s permissions need to be changed into protected mode from writing and editing, as a security measure.


Common errors Seen on Wordpress, Drupal and other scripts caused due to File permissions which fails to meet Scripts requirements:-


wordpress-error


db-cache-reloaded-fix


magento-write-permissions


intall-error


img error



Value Meaning

777

 Anybody may do anything. Least secure, the user should only use these settings if they know what they are doing.

755

The file's owner may read, write, and execute the file. All others may read and execute the file. Appropriate when you have programs or scripts that must be executed by non-owner users.

700

The file's owner may read, write, and execute the file. Nobody else has any rights. This setting is useful for programs that only the owner may use and must be kept private from others.

666

All users may read and write the file.

644

The owner may read and write a file, while all others may only read the file. A common setting for data files that everybody may read, but only the owner may change.

766
Read and Write. Works well for cache folders or upload folders where content must be written, but not executed. It means that the directory is readable and writable by WordPress and all other users on your system.



You can change your file permissions easily by following certain steps which are as follows:-

Using File Manager in cPanel

  1. Login to your cPanel
  2. Click -> File Manager
  3. Click -> File name for which you would like to alter the permissions.
  4. Select-> Change Permissions link at the top right of the page.
  5. Select-> the permissions you would like to set for the file.

A common concern is using file permissions of 777 to make file/folders writable which help the script to read/write/edit files.

  1. Click Change Permissions

fm


cPanel-file-permissions-change

 

777 permissions on folders/files is a website security risk. So, we would not recommend you to use 777 command over your files and folders. You can apply 755 permissions too, file's owner may read, write, and execute the file. All others may read and execute the file. Appropriate when you have programs or scripts that must be executed by non-owner users. Therefore, most scripts can work when you use 755.

 

Permissions Details:-

  • Read = 4.
  • Write = 2.
  • Execute = 1.
  • No permissions for a user is equal to 0.

Therefore……

  • Write/Execute without Read = 3.
  • Read /Execute without Write = 5.
  • Read/ Write without Execute = 6.
  • Read /Write and Execute = 7.

 

Using FTP

Simply connect to FTP through FTP Client such as Filezilla, smartFTP.

1.      Go to the file and right click. Choose Permissions or Attributes or Properties.

2.      Apply 777 or 755 permission.


Owner

Group

World

Read

Write



Execute

 



ftp perm


Using SSH or a script

Simply use chmod command with your directory name and press Enter.


Example:-

chmod 755 configuration.php

#Above command changes the permissions of configuration.php to 755

 

chmod -R 755 
#This will modify the permissions of all files in the current folder and set them to 755.

 

 

  • 0 Usuários acharam útil
Esta resposta lhe foi útil?

Related Articles

What is FTP?

The File Transfer Protocol (File Transfer Protocol) or FTP, is a communication protocol...

Connecting to an FTP server

Using the Quick Connect barUsing Site ManagerYou can use the FileZilla Site Manager to specify...

How to log into cPanel

cPanel (control Panel) is a management tool based on web technologies for managing sites easily,...

How to Connect to the MySQL Database

To work with the database in PHP, you must first connect the script to the MYSQL Database. We...

Managing Your Database Using phpMyAdmin

Migrating WordPress website is certainly not something that we have to do every day, but it...