Stop Core Files in cPanel

In cPanel servers which are using suexe and suphp when the PHP process is being killed by any reason such as wrong arguments in the php.ini file some core files following with a number will be generated in accounts home folder. These files make the the user home folder messed up but the most annoying thing about them is that they eat up the free space! I was responsible to manage this cPanel server which were running Config Exploit Scanner by Config Server. Suddenly I received multiple email of HITs by CXS about core files in accounts folder! seems like the server were having some difficulties with the PHP handler which I fixed! anyway to stop storing core files in cPanel accounts home folder in case such things happen to the server you need to edit the file /etc/init.d/httpd.

To do it you can use nano, vi or any other editor. Open up the file and look for following arguments inside of it:

 

then add ulimit –c 0 after the last line of ulimit! so it will be like this:

ulimit -n 1024
ulimit -n 4096
ulimit -n 8192
ulimit -n 16384
ulimit -c 0

 

well that’s it! restart the httpd using:

service httpd restart

 

after this the core files wont be stored in any folders anymore.

Incoming search terms:

  • ulimit -v
  • how to create core file in cpanel
  • ulimit 0 cpanel

Join the Conversation

1 Comment

Leave a comment

Leave a Reply