: PHPPermissions5

Welcome :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Most recent edit on 2008-06-19 18:16:03 by AndrewBoring

Additions:
-rw-r--r--   john john   566 May 23 19:05 index.php     # This is chmod 644 (correct)
-rw-rw-rw-   john john  171 May  7 21:00 main.php       # This is chmod 666 (incorrect)
drwxr-xr-x   john john  4096 Jan 1 21:00  folder1/      # This is chmod 755 (correct)
drwxrwxrwx   john john  4096 Jan 1 21:00  folder1/      # This is chmod 777 (incorrect)


Deletions:
-rw-r--r--   john john   566 May 23 19:05 index.php    <- This is chmod 644 (correct)
-rw-rw-rw-   john john  171 May  7 21:00 main.php      <- This is chmod 666 (incorrect)
drwxr-xr-x   john john  4096 Jan 1 21:00  folder1/     <- This is chmod 755 (correct)
drwxrwxrwx   john john  4096 Jan 1 21:00  folder1/     <- This is chmod 777 (incorrect)




Edited on 2008-06-19 18:15:44 by AndrewBoring

Additions:
john@example.com [/home/john]$ chmod -R g-w *        # Removes group-writable
john@example.com [/home/john]$ chmod -R o-w *        # Removes world-writable


Deletions:
john@example.com [/home/john]$ chmod -R g-w * <- Removed group-writable
john@example.com [/home/john]$ chmod -R o-w * <- Removes world-writable




Edited on 2008-06-19 18:14:24 by AndrewBoring

Additions:
%%-rw-r--r-- john john 566 May 23 19:05 index.php <- This is chmod 644 (correct)

Deletions:
%%-rw-r--r-- john john 566 May 23 19:05 index.php <- This is chmod 644 (correct)



Edited on 2008-06-19 18:14:05 by AndrewBoring

Additions:
%%-rw-r--r-- john john 566 May 23 19:05 index.php <- This is chmod 644 (correct)

Deletions:
%%-rw-r--r-- john john 566 May 23 19:05 index.php < - This is chmod 644 (correct)



Edited on 2008-06-19 18:13:58 by AndrewBoring

Additions:
-rw-rw-rw- john john 171 May 7 21:00 main.php <- This is chmod 666 (incorrect)
drwxr-xr-x john john 4096 Jan 1 21:00 folder1/ <- This is chmod 755 (correct)
drwxrwxrwx john john 4096 Jan 1 21:00 folder1/ <- This is chmod 777 (incorrect)%%


Deletions:
-rw-rw-rw- john john 171 May 7 21:00 main.php <- This is chmod 666 (incorrect)
drwxr-xr-x john john 4096 Jan 1 21:00 folder1/ <- This is chmod 755 (correct)
drwxrwxrwx john john 4096 Jan 1 21:00 folder1/ <- This is chmod 777 (incorrect)%%




Edited on 2008-06-19 18:13:24 by AndrewBoring

Additions:
-rw-rw-rw- john john 171 May 7 21:00 main.php <- This is chmod 666 (incorrect)
drwxr-xr-x john john 4096 Jan 1 21:00 folder1/ <- This is chmod 755 (correct)
drwxrwxrwx john john 4096 Jan 1 21:00 folder1/ <- This is chmod 777 (incorrect)%%


Deletions:
-rw-rw-rw- john john 171 May 7 21:00 main.php <- This is chmod 666 (incorrect)
drwxr-xr-x john john 4096 Jan 1 21:00 folder1/ <- This is chmod 755 (correct)
drwxrwxrwx john john 4096 Jan 1 21:00 folder1/ <- This is chmod 777 (incorrect)%%




Edited on 2008-06-19 18:13:02 by AndrewBoring

Additions:
Here is an example of a directory listing with Unix permissions:
-rw-r--r--    john john   566 May 23 19:05 index.php   < - This is chmod 644 (correct)
drwxrwxrwx   john john  4096 Jan 1 21:00  folder1/    <- This is chmod 777 (incorrect)


Deletions:
Here is an example:
-rw-r--r-- john john 566 May 23 19:05 index.php < - This is chmod 644 (correct)
drwxrwxrwx john john 4096 Jan 1 21:00 folder1/ <- This is chmod 777 (incorrect)




Edited on 2008-06-19 18:12:17 by AndrewBoring

Additions:
PHP 5 runs under the suPHP module, and executes as a CGI. This means that all scripts will run under your User ID, and NOT the user ID of the web server. This is different from PHP4 as an Apache module.
All files must be owned by your user ID and the permissions must be 644 for files and 755 for directories. Any files that are "group-writable" (664/775) or "world-writable" (666/777) will result in a 500 Internal Server Error.
If you previously had the default PHP4 enabled for your account and switch to PHP5, you may need to check all your file permissions to be sure all files are 644 and directories 755. You can change these in most FTP clients.
Here is an example:
-rw-r--r-- john john 566 May 23 19:05 index.php < - This is chmod 644 (correct)
-rw-rw-rw- john john 171 May 7 21:00 main.php <- This is chmod 666 (incorrect)
drwxr-xr-x john john 4096 Jan 1 21:00 folder1/ <- This is chmod 755 (correct)
drwxrwxrwx john john 4096 Jan 1 21:00 folder1/ <- This is chmod 777 (incorrect)
If you are comfortable with using SSH and Unix commands, you can enter these two commands to remove group/world-writable permissions:
john@example.com [/home/john]$ chmod -R g-w * <- Removed group-writable
john@example.com [/home/john]$ chmod -R o-w * <- Removes world-writable




Oldest known version of this page was edited on 2008-05-29 11:52:07 by AndrewBoring []
Page view:
Understanding File Ownership and Permissions in PHP 5





Back to PHP
Back to Main
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.0789 seconds