Support » Fixing WordPress » Parse errors on random lines but page load after refreshing several times

  • Resolved simonechristine

    (@simonechristine)


    Hello!

    I would like to ask if anyone has seen this problem and knows the solution for it.

    I believe that I began to see this issue several days ago when I upgraded to WordPress 5.5.1 and upgraded many plugins.

    Whenever I re-save my functions.php file (it doesn’t matter if I make any changes) and reload any wordpress webpage, I see “Parse error: syntax error, unexpected end of file, expecting ‘(‘ in functions.php on line xxxx
    There has been a critical error on your website.

    It’s not always the same line number. The suggested line almost seems random because it occurs at the most impossible places, such as blank line, comment, or very ordinary php code.

    I refresh, then, two, three times, seeing several parse errors messages, and then the website reloads just fine, like normal. As long as I don’t re-save functions.php, there is no issue.

    What can be the problem that causes this kind of “temporary” parse error messages? Temporary, because upon refreshing a couple times, the site loads just fine. I tried to paste code on online php syntax checker and none returned any problem.

    Normally, when we see this kind of parse error, it means something really is wrong, and one should fix something, otherwise the site won’t load (“critical error”). But, that’s not what I am seeing. The site loads fine after refreshing several times (and will load just fine as long as no re-save on functions.php).

    Thank you so much for your attention and kind assistance.

    Best wishes,
    Simone

Viewing 1 replies (of 1 total)
  • WebsiteGuider

    (@websiteguiderteam1618)

    Hi,
    Please show the error you are getting. You quoted XXXX that way we can’t help you because we don’t know what error you are getting.
    Thanks

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.