title: Nginx on macOS : open files resource limit
body: <p>I'm having configuration errors and I have researched online but I'm not quite sure what the problem is.  I'm wanting to install PHP and Nginx on a os x 10.7.5 operating system.  Whenever i try to start or stop the server I get the following errors:</p>
  
  <pre><code>tone$ nginx
  nginx: [warn] 1024 worker_connections exceed open file resource limit: 256
  alcfwl128:~ tolbert$ nginx: [emerg] open() "/usr/local/Cellar/nginx/1.4.3/logs/nginx.pid" failed (2: No such file or directory)
  
  nginx -s stop
  nginx: [error] open() "/usr/local/Cellar/nginx/1.4.3/logs/nginx.pid" failed (2: No such file or directory)
  </code></pre>
  
  <p>For the first error I have tried the following command: <code>tone$ ulimit -n 65536</code></p>
  
  <p>But I get this error: <code>-bash: ulimit: open files: cannot modify limit: Invalid argument</code>
  I'm not sure if I'm to create the logs folder in the directory along with the nginx.pid file or if it is located somewhere else. Your help is appreciated.</p>