title: PHP chmod( ):Operation not permitted, safe_mode deprecation involved?
body: <p>I'm struggling a bit to grasp the concept of <code>chmod()</code> from PHP as the course I'm currently taking is a bit outdated and involves safe_mode. It states that as safe_mode is turned off, the restrictions to modify permissions with <code>chmod()</code> to a file when the owner is not the same as the one executing the command are removed. I'm working with PHP 5.5.9 in conjuncture with XAMPP, I've verified that the flags are turned off (just in case), but can't seem to get it working. As I execute the following PHP script:</p>
  
  <pre><code>echo "File permissions :" .  decoct(fileperms("file_permissions.php"));
  chmod("file_permissions.php" ,0777);
  </code></pre>
  
  <p>I receive the following output :</p>
  
  <pre><code>Warning: chmod(): Operation not permitted
  </code></pre>
  
  <p>My permissions for the file are the following</p>
  
  <pre><code>-rwxrwxrwx@  1 joelhernandez  staff     24 Apr 14 06:59 file_permissions.php
  </code></pre>
  
  <p>And I've executed <code>ps aux | grep httpd</code> to confirm that the <strong>my webserver is operating under the user "daemon" .</strong> </p>
  
  <p>As I change the file ownership to <strong>daemon</strong>:</p>
  
  <pre><code>-rwxrwxrwx@  1 daemon  staff     24 Apr 14 06:59 file_permissions.php
  </code></pre>
  
  <p>Everything works, I do not understand why as I had understood that with safe_mode turned off, file ownership would mean nothing, instead file permissions were the way to handle access.</p>