Very strange problem with include() and require()

This is bizarre. I’m going to describe the problem as verbosely as possible so it will hopefully be clear exactly what’s going on:

I have a main “functions.php” file that I require_once() on every page of my site.

In functions.php, I require_once() a file called vars.php.

Also in functions.php, there is a single function that uses ob_start(“ob_gzhandler”)

Everything works fine so far. However…

If I try to include another file in functions.php, my pages won’t load and give an “invalid or unsupported encryption” error.

Somehow, even just copying vars.php, renaming it, and requiring the newvars.php file from functions.php still causes the error.

Permissions on the files are the same. Nothing relevant in .htaccess either.

However, if I comment out the ob_start(“ob_gzhandler”) from the function that uses it, everything is fine.

What in the world is going on here? It seems completely illogical and unreal.

Are you using ob_start(“ob_gzhandler”) before any output or you already outputted something?

It’s before any output. However, note that simply renaming the vars.php file and including that from functions.php also produces the error, with no changes actually made to either file. That’s part of what makes this so bizarre.

Okay, making some progress…it appears to be related to text encoding. But it’s still really weird.

My default character set is UTF-8, set in my .htaccess file. functions.php and all the files I’ve tried to include from it were encoded with UTF-8. Somehow, although it works fine to include vars.php as UTF-8, any other files I want to include need to be encoded as ISO-8859-1.

I have no clue why this would be and can’t figure out how in the world a UTF-8 encoded file can include ONE other specific UTF-8 file but needs all the others to be ISO-8859-1, when the default character set is UTF-8 anyway. I would have thought that, if anything, the files would all need to be the same text encoding, but that’s sure not the case here.

Any ideas?