Why is there many php.ini files in a system?

getting error Too many open files in system

  • I am running a cron and output coming to my id and getting below as output: /bin/sh: /usr/bin/php: Too many open files in system Cron runs every 5 mins. Have checked /var/logs/cron and cron is executed every 5 mins. Sites are working fine on the server.

  • Answer:

    This means your system ran out of file handles, either in your php or in another application. Make sure to http://php.net/fclose any files you open to free file handles. To the number of handles of every program running, use (as root): for p in $(ps -A -o pid); do nh=$(ls /proc/$p/fd 2>/dev/null | wc -l) && exe=$(readlink -f /proc/$p/exe 2>/dev/null) && echo "$p ($exe): $nh" done For a more verbose output, use lsof. You can also increase the number of possible system file handles by modyfing http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/sag-pam_limits.html (which effects changes to http://www.kernel.org/doc/Documentation/sysctl/fs.txt), and decrease it for the current terminal session with ulimit -n.

Alok at Server Fault Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.