title: PHP script executed in MAC terminal: failed to open stream: Permission denied
body: <p>I have a problem.
  I have a PHP script that does some actions and then create a .txt to put some logs into it.</p>
  
  <p>When I run the script using my browser, it works perfectly, creates the txt file (one new is created each time the script is used), writes the logs into it ..</p>
  
  <p>BUT
  When I launch the script from the terminal using the command php, then I have the error: 
  Warning fopen [...] failed to open stream: Permission denied</p>
  
  <p>The permissions for the folder where I save the logs is 755. The folder is inside /Library/WebServer/Documents/ 
  _www is the owner of the folder.</p>
  
  <p>Thanks for your help.</p>