Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The question is... writable by who or what? You probably need to make the entire "uploads" directory writable by PHP (a.k.a. the web server). Often, apache and other servers default to the user-group <code>www-data</code>, but it could be different. Check your apache or lighttpd (or whatever) configuration files to see what user and user-group it runs as. Often these are in <code>/etc/apache</code> or <code>/etc/lighttpd</code> <em>et cetera</em>. Then, make the uploads directory recursively writable to that group.</p> <p>Using 777 permissions is a very bad idea. You always want to give the minimal amount of people access to any given directory. So, here's a short discourse on file permissions....</p> <pre><code>drwxrwxrwx 20 connermcd staff 680 Jul 25 20:38 img -rw-r--r-- 1 admin www-data 18530 Jul 26 21:46 example </code></pre> <p>The first character of the permissions string denotes the type. In this case, <code>img</code> is a directory and <code>example</code> is a file. This could also be an <code>l</code> for a symbolic link (among other things). The remaining characters of the string (<code>rwxrwxrwx</code>) define permissions. As you can see, it's a repeating triplet of "read, write, execute". The first triad represents permission for the file or directory's owner. The owner is shown in the third column (connermcd for img and admin for example). The second triad denotes permission for the file or directory's group (staff for img and www-data for example). The last triad denotes permissions for <em>anyone</em> (even someone you gave temporary access to your server or a hacker, hint hint).</p> <p>Each of the "read, write, execute" triads can be represented by a number. It's easy for me to think about <code>rwxrwxrwx</code> as <code>421421421</code>. It's the only way multiples of two can add up to 7 if that helps you. So, the 4 stands for read, the 2 stands for write, and the 1 stands for execute. If you add these together then you can denote a triad with three numbers. So what <code>chmod 777 img</code> is really doing is giving "read, write, and execute" permission to <em>everyone</em>. It is also only setting those permissions for that directory and not the directories underneath it. To do this recursively you can use the <code>-R</code> flag -- <code>chmod -R</code>.</p> <p>In your case, you just want to make the uploads folder and all its subdirectories available to the user group your server runs as. In most cases that's <code>www-data</code>, so I'll use that as an example. You probably want to set your project files as owned by your user to make them easier to move, edit, etc. So let's assume you are the owner of the files (use <code>chown</code> to set) and that they belong to the <code>www-data</code> group (use <code>chgrp</code> to set). In that case we want to give the owner full permissions and the group read and write permissions, and we want to do it recursively. So go to the parent directory of the uploads folder and do <code>chmod -R 760 uploads</code>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload