PHP Fatal Flex Scanner Internal Error

Recently when coding in PHP I got this error:

Fatal error: fatal flex scanner internal error–end of buffer missed in [file] on [line number]

Turns out it was because I forgot to close a comment block (forgot the */). Thought I’d post it here in case it helps someone. :)

Was this post helpful? Share it!


  1. It helped me too. Thanks. This error is not very understandable.

  2. John, you are a life saver! I’ve been trying to figure out the problem for days and you nailed it. One small correction to the code and FIXED!
    Thanks, Janet

  3. Dan

    John, the error points to the beginning of a comment block (/**) in the file.
    what could it be please?

  4. John

    Dan, you sould end that comment block.

  5. Sam

    Hi there im having the same issue my error code is :

    Fatal error: fatal flex scanner internal error–end of buffer missed in /home/lfcsemin/public_html/wp-includes/class-simplepie.php on line 1266

    i went to the cpanel and in that php file all there is on that line is below:


    what should i do ? im a beginner big time . somebody said up on the thread to close the comment block . how do you do that ?

    help please thank you

  6. Sam

    on line 1266 there is : /**
    on line 1267 there is : * Allows

    the file ends there

  7. Amy

    Yes! Thank you, thank you for taking the time to share. Whew! And thanks to Google search, fixed the problem I accidentally created in mere minutes. :-)

  8. Dear John,

    I love you. 1st result in Google and fixed in less than 2 min.


  9. Doug

    Thanks, I was wondering what that error was about, the error was caused by the same reason you had it.

  10. John

    Thank’s, helped me too!

  11. Kanny

    Thanks,helped me but i am getting a blank page.Please help me out this.

  12. I had this error in my logs as well, except the comment block was terminated correctly. The previous error in my log (PHP Warning: Unterminated comment starting line 351 in file.php on line 351) gave away that PHP thought the file contained an unterminated comment block.

    While I am not 100% sure what caused the error, I believe that the file was probably read while I was uploading a new version of the file. Likely the file had only uploaded as far as the start of the comment block, and so this error was generated.

    Just thought I’d add that for info in case anyone else gets this error in a similar situation.

  13. Thiago Moskito

    João, você ajudou muita gente! Para esclarecer uma dúvida para quem usa wordpress, a solução é simples.
    Mude todas as linhas iniciadas em:




    só isso!

    (Eu mandei localizar e substituir em todos os arquivos e pronto!)

    * Lorem ipsum
    * Lorem ipsum dolor
    * Ipsum sit amet

    Vai ficar

    * Lorem ipsum
    * Lorem ipsum dolor
    * Ipsum sit amet



    John, you helped a lot of people! To clarify a question for those who use wordpress, the solution is simple.
    Change all lines beginning at:




    only that!

    (I sent find and replace on all the files and go!)

    * Lorem ipsum
    * Lorem ipsum dolor
    * Ipsum sit amet

    will stay

    * Lorem ipsum
    * Lorem ipsum dolor
    * Ipsum sit amet


  14. Fatal error: fatal flex scanner internal error–end of buffer missed in D:INETPUBVHOSTS**************httpdocswp-contentpluginsusquare_v1.6pagesusquare_class.php on line 1

    this error occurs for me but same code working fine in my test server. help me to fix this thanks in advance..

  15. Semillero

    you just saved my life :)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>