User Tools

Site Tools


dokuwiki:upgrade_dokuwiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dokuwiki:upgrade_dokuwiki [2020/03/08 18:26] 192.168.1.69dokuwiki:upgrade_dokuwiki [2022/06/30 18:12] (current) 45.89.242.195
Line 7: Line 7:
 </code> </code>
  
-This will create the **dokuwiki-backup.tar.gz** backup.+<WRAP info> 
 +**NOTE:**  This will create the **dokuwiki-backup.tar.gz** backup. 
 +</WRAP> 
  
 ---- ----
Line 44: Line 47:
 </code> </code>
                
-The quotes on cp assure that it will run as is, even if an alias is set.+<WRAP info> 
 +**NOTE:**  The quotes on **cp** assure that it will run as is, even if an alias is set. 
 +</WRAP> 
  
 ---- ----
Line 54: Line 60:
    
 if(function_exists('posix_geteuid')){ if(function_exists('posix_geteuid')){
-    // use posix to get current uid and gid +  // use posix to get current uid and gid 
-    $uid   = posix_geteuid(); +  $uid   = posix_geteuid(); 
-    $usr   = posix_getpwuid($uid); +  $usr   = posix_getpwuid($uid); 
-    $user  = $usr['name']; +  $user  = $usr['name']; 
-    $gid   = posix_getegid(); +  $gid   = posix_getegid(); 
-    $grp   = posix_getgrgid($gid); +  $grp   = posix_getgrgid($gid); 
-    $group = $grp['name'];+  $group = $grp['name'];
 }else{ }else{
-    // try to create a file and read it's ids +  // try to create a file and read it's ids 
-    $tmp = tempnam ('/tmp', 'check'); +  $tmp = tempnam ('/tmp', 'check'); 
-    $uid = fileowner($tmp); +  $uid = fileowner($tmp); 
-    $gid = filegroup($tmp);+  $gid = filegroup($tmp);
    
-    // try to run ls on it +  // try to run ls on it 
-    $out = `ls -l $tmp`; +  $out = `ls -l $tmp`; 
-    $lst = explode(' ',$out); +  $lst = explode(' ',$out); 
-    $user  = $lst[2]; +  $user  = $lst[2]; 
-    $group = $lst[3]; +  $group = $lst[3]; 
-    unlink($tmp);+  unlink($tmp);
 } }
    
 echo "Your PHP process seems to run with the UID $uid ($user) and the GID $gid ($group)\n"; ?> echo "Your PHP process seems to run with the UID $uid ($user) and the GID $gid ($group)\n"; ?>
 </code> </code>
 +
 +
 +Here are the most commonly used values for setting permissions on directories and files.
 +
 +^directories^files^result^
 +|0700|0600|read/write for owner only. Owner must be the same as the PHP process user.|
 +|0770|0660|read/write for owner and group. The PHP process user needs to be in the user group|
 +|0777|0666|read/write for everyone. Dangerous because everybody with access to the server may write and delete your files. Use only as a last resort on trusted machines, NOT on a cheap shared hosting server.|
  
  
dokuwiki/upgrade_dokuwiki.1583691980.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki