title: PHP failed to open stream: Too many open files
body: <p>I have a problem with the error: PHP failed to open stream: Too many open files.</p>
  
  <p>I have looked on various answers here on stackoverflow, but I am unable to solve this issue. I have mainly tried to increase the limit of max. open files:</p>
  
  <p>I have edited /etc/security/limits.conf where I specified this:</p>
  
  <pre><code>*       soft    nofile      10000
  *       hard    nofile      30000
  </code></pre>
  
  <p>After saving and logging out / rebooting the box, the command:</p>
  
  <pre><code>ulimit -n
  </code></pre>
  
  <p>Still prints out 1024. I am not sure why this has no effect and I think this is the reason I get the php error. If needed I can paste the whole file or any other configuration file. I am using PHP 5.6, nginx 1.8.0 and php-fpm.</p>
  
  <p>The solution which works for me now is to manually restart nginx with:</p>
  
  <pre><code>service nginx restart
  </code></pre>
  
  <p>After this things work again. Mainly the problem occurs when I run unit tests, behat tests or when I make a lot of requests to the web server.</p>