• Register

Unexpected End of File error occurs when a file does not have a proper closing tag. Sometimes this error can present itself as the White screen of death, or a 500 error. If so then you can able to determine the error is caused by an “unexpected end of file” by looking at your error logs in your WP Engine User Portal.


This error can be solved in two ways;

  • Restore the website
  • Correct the file

Restore the website:

Once you have confirmed the issue is due to an unexpected end of file error, then the simplest way to resolve the issue is to restore the website to the last known good state, if it is possible. This is most likely the point just before any recent code changes.

Correct the file:

If restoring the website is not a valuable option, then you can also fix it by downloading it over SFTP or opening it in SSH Gateway. Once you fixed the broken file by adding a proper closing tag, be sure you have saved and uploaded the file. You may also need to purge the cache.

After fixing the file, your website should normally again.

posted Jul 9 in php 160 points