Core files being generated by something

I seem to have core files that are being generated by my website and am not sure why. How would I go about figure out why they are happening and stop them from generating? (I'm sorry in advance I'm a beginning blogger with not much technical background).

  • Kris Tomczyk

    Hi Chas

    Hope you are doing good today.

    The core files you talk about here are called "Core Dump files".

    In some cases(not many) those core files are created by plugins. To check that please deactivate all plugins and check if the problem gone. If so, then enable all plugins one by one and find which one is having conflict.

    As this article says:
    https://complete-concrete-concise.com/web-tools/wordpress-generating-core-dumps

    When your error_log file gets to be 2,147,483,647 bytes long, PHP will start crashing and generating core dumps. This is because PHP cannot handle files larger than 2GB.

    Can you also follow above article and see if this will help?

    Can you also share a screenshot of those files from your FTP and share any of this file on dropbox or google drive to check what those files include there?

    Kind Regards,
    Kris

  • Chas

    Hi Kris,

    I will deactivate the plugins and add them back one by one. The problem is that I don't think the core files are created consistently so it might be hard to tell if one of these are causing it?

    I have read the other article and will work on giving that a shot, I'm an amateur so not sure I fully understand what to do there.

    Here is the screen shot...

    Thank for your help.

  • Nastia

    Hello Chas

    Hope you're doing well!

    Thank you for sharing this screenshot. Those are core dump files. They can occur when your code crashed, so this means there are plugins conflicting on your site with each other. Deleting these files, will not hurt anything.

    Please follow this tutorial to monitor which file is creating core dump files:
    https://www.webhostinghub.com/help/learn/website/website-help/core-dumps

    I also suggest activating WordPress debug and run a test for a conflict as Kris has suggested in above reply. The issue can be caused by any action that is done on your site, the debug.log and the coredumpcheck.php files will help to determine the issue faster.

    Hope this helps!

    Cheers,
    Nastia

  • Nahid

    Hey Chas !
    Hope you are doing well today!

    WordPress is not a plugin that you need to install. It is a built in feature in WordPress. You can enable debugging by putting the following constants in the wp-config.php file:

    // Enable WP_DEBUG mode
    define( 'WP_DEBUG', true );
    // Enable Debug logging to the /wp-content/debug.log file
    define( 'WP_DEBUG_LOG', true );
    // Disable display of errors and warnings
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );

    These constants must be added before the line "/* That's all, stop editing! Happy blogging. */" for them to work. Please make sure identical constants are replaced if they were already there previously.

    Enabling debugging in WordPress will log any errors that the site encounters in a log file named "debug.log" located in the "wp-content" folder. Please upload the debug.log file in a cloud storage platform like Dropbox and attach the shared link in your next response so that we can take a look into it. You can know more about WordPress debugging in this handy article.

    Hope this helps. Let us know if you need any further help regarding this. Thanks!

    Kind regards,
    Nahid

  • Chas

    I went in to my wp-config.php file and found what you are saying. When I got down to the "happy blogging" line. You mention to put the code above this, and I just want to confirm so I don't mess something up. When looking here you mention to replace code if it exists, I don't see it so wanted to confirm that as well. Also I noticed there seems to be a line in there right now added by my webhost SiteGround. Didn't know if that meant something or not.

    Thank you for everything!

  • Chas

    Okay I have added the code, roughly how long will it take for the debug file to show up in the content folder so that I might share the file as requested?

    Thanks Ash, you are right we started delving into this issue but at the time I didn't realize that the core files were still being generated by something. Having the webhost look into it didn't work - they just deleted the core files and said contact a web developer.

    I can attach a core file now if that would help - they had deleted them all the first time.

    It was suggested it might be because of cron jobs but SiteGround has a set cron job they help install so help with the shared server and they did this to my site.

    Something is being generated somewhere else though besides these core files as my disk space usage creeped up again today but there are no new core files and I have added nothing to my website today.

  • Ash

    Ohh that is pointing to wp cron. So, there are two possibilities:

    1. Something on your site cron job, please check with the plugin James mentioned if you find anything unusual cron call (though I doubt that is the reason)
    2. Something on your host that creating those dump file. Try to get a senior support tech from the hosting support team for instance. Usually, to create dump file you would need greater permission than normal apache user have.

  • Chas

    I started with Defender. It says this in terms of wordpress core issues. I'm not sure what to do from here... Do I literally just select "fix"?

    Suspicious File Issue
    NO
    /home/goofychas/public_html/NO
    Unknown file in WordPress core
    default.html
    /home/goofychas/public_html/default.html
    Unknown file in WordPress core
    error_log
    /home/goofychas/public_html/error_log
    Unknown file in WordPress core
    favicon.ico
    /home/goofychas/public_html/favicon.ico
    Unknown file in WordPress core
    fix.php
    /home/goofychas/public_html/fix.php
    Unknown file in WordPress core
    gas.js
    /home/goofychas/public_html/gas.js
    Unknown file in WordPress core
    i.php
    /home/goofychas/public_html/i.php
    Unknown file in WordPress core
    php.ini
    /home/goofychas/public_html/php.ini
    Unknown file in WordPress core
    php_mail.log
    /home/goofychas/public_html/php_mail.log
    Unknown file in WordPress core
    wordfence-waf.php
    /home/goofychas/public_html/wordfence-waf.php
    Unknown file in WordPress core
    NO
    /home/goofychas/public_html/wp-admin/NO
    Unknown file in WordPress core
    error_log
    /home/goofychas/public_html/wp-admin/error_log
    Unknown file in WordPress core
    php_errorlog
    /home/goofychas/public_html/wp-admin/php_errorlog
    Unknown file in WordPress core
    php_mail.log
    /home/goofychas/public_html/wp-admin/php_mail.log
    Unknown file in WordPress core

  • Ash

    Hello Chas

    All of the files are not wordpress core, true, but seems most of them are error log related files. Not sure if there is any option in your hosting to move those log files permanently. If you delete now by "fix", logs will come back again.

    But, that doesn't have any relation with those core dump files. To be sure about those dump files, you can try another option.

    If you have another hosting from another company, create a replica of your current site to that hosting. The replica should be exactly same except the domain name will be different. Keep that site there for a week and check if you are getting .core files on that hosting too. If you don't see .core file in the new hosting, then you will be sure there is something in the old hosting.

    You can create replica and set to another domain using this plugin: https://premium.wpmudev.org/project/snapshot/

    Have a nice day!

    Cheers,
    Ash

  • Chas

    Okay I got some more information that might help from SiteGround ... The core.XXXX files are generated by a process which has used more than the allowed RAM. You can read more about Linux core dump file https://en.wikipedia.org/wiki/Core_dump

    Code:
    Core was generated by `/usr/local/php70/bin/php wp-cron.php'.
    Program terminated with signal 11, Segmentation fault.
    #0 0x00007f24a0bd554d in ?? ()
    "/home/goofychas/public_html/core.43846" is a core file.

    In this case you should contact with your website's developer or with WordPress specialist to review why exactly your website is limited to 18M while our servers' PHP memory_limit is 768M. I can not recommend you anyone in particular, but you can easily find a experienced specialist through some of the popular freelance websites.

    If there is anything that we can help with on server side, please do not hesitate to get back to us. We will be more than happy to assist with anything within our reach.

  • Nastia

    Hello chris

    Hope you're doing well!

    I've listed your site and the system info shows that PHP memory is at 40 MB and Max PHP memory is at 768MB.

    That's not should be a case, although please try increasing PHP memory by adding the following lines into the wp-config.php file:

    define('WP_MEMORY_LIMIT', '256M');
    define('WP_MAX_MEMORY_LIMIT', '768M');

    Make sure similar lines are not already added into the wp-config.php file.

    Also please check the .htaccess file for any memory restrictions added, look for this line:
    php_value memory_limit

    Then please search for php.ini files or php5.ini files, memory limit restrictions can be added there as well. Looks for this line:
    memory_limit =..M

    After this create a file called phpinfo.php. Add this code to it, and upload it to your root directory:
    <?php phpinfo(); ?>
    The information collected in this file will include what your PHP memory limit is currently set at. After the test is done, please remove it.

    Let us know how it went!

    Cheers,
    Nastia

  • Chas

    Where do I insert the - wp-config.php file:
    define('WP_MEMORY_LIMIT', '256M');
    define('WP_MAX_MEMORY_LIMIT', '768M');

    and I don't see any files like that in there.

    php_value memory_limit is not in my htaccess nor is the memory_limit =..M

    Where am I supposed to add this -
    After this create a file called phpinfo.php. Add this code to it, and upload it to your root directory:
    <?php phpinfo(); ?>
    And how do I run the test?

    Thank you

  • Dimitris

    Where do I insert the - wp-config.php file:
    define('WP_MEMORY_LIMIT', '256M');
    define('WP_MAX_MEMORY_LIMIT', '768M');

    wp-config.php file is in the root folder of your installation. You've already made some changes there, when you 'd enabled WP_DEBUG :wink:
    https://premium.wpmudev.org/forums/topic/core-files-being-generated-by-something#post-1317128

    php_value memory_limit is not in my htaccess nor is the memory_limit =..M

    php_value memory_limit can only be in .htaccess file.
    Is there any php.ini or php5.ini or .user.ini file in the root folder? Like in the same folder where wp-config.php is. If so, then check if it has something like
    memory_limit =
    If not, then add in a new line this:
    memory_limit = 768M

    Where am I supposed to add this -
    After this create a file called phpinfo.php.
    ...
    And how do I run the test?

    You should create this phpinfo.php file in the root folder, where the wp-config.php is. In there add the following line:
    <?php phpinfo(); ?>
    After saving this file, open your browser and go to yourdomain.com/phpinfo.php and you should be seeing the details of your PHP installation.

    Warm regards,
    Dimitris

  • Chas

    Okay, I've added this to my wp_config.php file... I just hope I put it in the correct place. I'll attach a screen shot.

    define('WP_MEMORY_LIMIT', '256M':wink:;
    define('WP_MAX_MEMORY_LIMIT', '768M':wink:;

    I did find .user.ini in the Htacess - I'll attach the screen shot...
    "php_value memory_limit can only be in .htaccess file.
    Is there any php.ini or php5.ini or .user.ini file in the root folder? Like in the same folder where wp-config.php is. If so, then check if it has something like
    memory_limit =
    If not, then add in a new line this:
    memory_limit = 768M"

    So do I need to fix that, or am I adding this new memory limit in the wpconfig.php or am I adding it to the htaccess and if so where and what line?

    Then for this part - <?php phpinfo(); ?> I need to add that as well to the wpconfig.php file as well? Any particular "line"?

    Thank you

  • Ash

    Hello Chas

    <?php phpinfo(); ?> should be in a completely separate file :slight_smile:

    By the way, do you still have core files on your server? If so, then copy some of those files and put in a folder on root, for example, the name of the folder is test. Inside that folder, create another file called index.php and add the following code: https://pastebin.com/x3afuf9K

    Now visit the url: http://YOUR-DOMAIN.com/test/index.php and that will show something on the browser. Send me those. Make sure you use the correct URL to test.

    Have a nice day!

    Cheers,
    Ash

  • Chas

    Hi Ash,

    I'm not sure I'm doing it right, but I created the folder named test, then created the file inside named index.php, inside that I added the code. I copied and moved one of the core files and I'll attach the screen shots of what I got...

    Picture 1 is the core files
    Pictures 2 says I cannot open the code editor because the file is too big
    Picture 3 what happens when I do this - http://chascrazycreations.com/test/index.php

  • James Morris

    Hello Chas

    In order to help you better with your issue, would you please grant us access to your site and server so we can perform some advanced debugging?

    NOTE: Please make a full backup of your site before sending the following information.

    Please visit the Contact page and complete the form with the following information:

    https://premium.wpmudev.org/contact/#i-have-a-different-question

    Option: I have a different Question

    Subject: "Attn: James Morris"

    In the Message box, please provide the following:

    - link back to this thread for reference
    - any other relevant urls

    - Admin login:
    Admin username
    Admin password
    Login url

    - Hosting Control Panel Login
    Admin username
    Admin password
    Login url

    ~OR~

    - FTP credentials
    host
    username
    password
    (and port if required)

    Best regards,

    James Morris

  • James Morris

    Hello Chas

    Thank you for sending in that information. The core.#### files are binary files and cannot be viewed like text files. They take a specific type of program to read them. The #### number value at the end of the file name is the process ID of what caused the core dump. In every case in your situation, it was wp-cron.php causing the core dump. From SiteGround's docs, here's the most common causes of core dumps:

    A script a part of your website tried to access memory not assigned to it
    A script ended prematurely due to critical errors in its code
    Improper use of the PHP libraries

    So, most likely, what was happening is a plugin that had a registered cron task was terminating with an error and causing the dumps.

    I temporarily installed Advanced Cron Manager and triggered all cron jobs at the same time. Everything ran flawlessly and no new core.#### files were generated.

    Other than some minor PHP Notices in your debug.log from Swift Performance, I'm not finding any errors in your logs. However, if you were performing any changes on your site around the time the dump files were generated and a Fatal PHP Error occurred, then this could also cause these files.

    At this point, I've been unable to replicate the creation of these core dump. What I recommend doing is cleaning up the old core dump files and then, when you go to perform changes on your site, edit wp-config.php and change define( 'WP_DEBUG', false ); to define( 'WP_DEBUG', true );. If any errors occur while making changes and another core.#### file is generated, the resulting debug.log output will give some pointers as to what may have caused the error.

    I hope this clarifies a bit. Let us know if you have any further questions. We'll be happy to help! :slight_smile:

    Best regards,

    James Morris

  • Dimitris

    Hello Chas

    In order to be sure that all debug information won't display on screen, but only in debug.log file, please replace

    // Enable WP_DEBUG mode
    define( 'WP_DEBUG', true );
    // Enable Debug logging to the /wp-content/debug.log file
    define( 'WP_DEBUG_LOG', true );
    // Disable display of errors and warnings
    define( 'WP_DEBUG_DISPLAY', true );
    @ini_set( 'display_errors', 0 );

    with

    // Enable WP_DEBUG mode
    define( 'WP_DEBUG', true );
    // Enable Debug logging to the /wp-content/debug.log file
    define( 'WP_DEBUG_LOG', true );
    // Disable display of errors and warnings
    define( 'WP_DEBUG_DISPLAY', false );
    @ini_set( 'display_errors', 0 );

    Reference: https://premium.wpmudev.org/blog/debugging-wordpress-how-to-use-wp_debug/

    Warm regards,
    Dimitris :slight_smile: