We have Drupal up and running on a MS Server 2003 (IIS) box that is running PHP version 5.2.0 and MySQL version 5.0.22. We randomly get errors and the site shuts down. Listed below are two examples of the errors that we are getting.


Fatal error: fatal flex scanner internal error--end of buffer missed in D:\clients\site\includes\path.inc on line 208

PHP has encountered an Access Violation at 77BAD9DE


It appears that the memory is being comsumed and killing the memory space that we allocated for this process on IIS. We have to go in and recycle the memory pool to allow the site to run again. I did not know if anyone else was seeing issues similiar to this, and if so, what steps could be take to try and keep this from eating up all of the memory. Please advise. Thank you for your help with this.

- John -


Zen’s picture

Try adding closing PHP tags ( ?>) to any (or all) files that come up with this error. It might also be best to ensure that no whitespace is added after the closing tag.

This is a PHP bug.


jgodfrey’s picture


Thank you for the response. I have went in and tried that and it did not seem to help. This is kind of frustrating as it crashes the site periodically. We have enabled some scripts on the 2k3 Server in IIS to automatically recycle the memory pool at the top of the hour every hour. This is helping some, but I do not feel that was a permanent fix.

If you or anyone else has any more ideas or suggestions I would be grateful to explore them.

Thanks again and have a great day!!!

- John -

jgodfrey’s picture

To the best of my knowledge the PHP Error given above references an issue with memory. I did not know if there were any other suggestions for trying to remedy this.


agucho’s picture

I was having the same problem and it does seem to be a PHP bug. More info here:

It has something to do with PHP choking on scripts that end with a comment. Like:

function theme_cck_address_display($form) {
  return drupal_render($form);
} //function theme_cck_address_display

In my case the error was exactly:

Fatal error: fatal flex scanner internal error--end of buffer missed in C:\Program Files\xampp\htdocs\drupaltest1\sites\all\modules\cck_address\cck_address.module on line 540

More info: I'm runing PHP 5.1.1 on Apache (XAMPP 1.5.1) on WinXP.

In my case, changing the code so it doesn't end with a comment worked fine. Either adding the ?> at the end (as suggested) or removing the comment and even just adding an empty line... (not commented of course).

N-Crowd’s picture

I had a similar issue and fixed it by changing the following line (1447) in form.inc - which the error page was complaining about...

* the #limit_validation_errors property. Multistep forms not wanting to
* the limit_validation_errors property. Multistep forms not wanting to

Not clear on why Drupal did not like this "commented" line, but removing the hash sign fixed the issue.