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!

18 Comments

  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.

    Paul

  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. 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.

  12. 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:

    /**

    para

    /*

    só isso!

    (Eu mandei localizar e substituir em todos os arquivos e pronto!)
    Exemplo/Exemple:

    /**
    * Lorem ipsum
    * Lorem ipsum dolor
    * Ipsum sit amet
    */

    Vai ficar

    /*
    * Lorem ipsum
    * Lorem ipsum dolor
    * Ipsum sit amet
    */

    Abraços!

    ————————-

    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:

    /**

    to

     /*

    only that!

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

    /**
    * Lorem ipsum
    * Lorem ipsum dolor
    * Ipsum sit amet
    */

    will stay

    /*
    * Lorem ipsum
    * Lorem ipsum dolor
    * Ipsum sit amet
    */

    Hugs!

  13. Fatal error: fatal flex scanner internal error–end of buffer missed in D:\INETPUB\VHOSTS\**************\httpdocs\wp-content\plugins\usquare_v1.6\pages\usquare_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..

  14. Semillero

    Thanks!
    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>