title: How to check from php code running in terminal (PHPUnit) if php code running in Apache will be able to write to a folder?
body: <p>I have file_put_contents code in PHPUnit that can always successfully write a file to a folder with permissions 744.</p>
  
  <p>I have identical file_put_contents website code that cannot write to the same folder unless I max out permissions to 777.</p>
  
  <p>The PHPUnit code is giving me a sort of false positive.</p>