require_once not working

I created a class file and used require_once to include it in an existing (and working) php file (say main1.php).
The result of this file is the creation of an excel file with some data in it.

However, after my code changes the resulting file is corrupt.

If instead of require_once, I copy/paste the entire class code into the “main1.php” file it works fine and creates a good excel file.

I checked the location access & permissions of the class file and they seem to be correct.

The interesting thing is that the require_once that existed before my changes, they still work fine.

Please let me know if anyone has encountered this before. I can send more info if required.

I got it resolved.

The reason was that my class file had an extra line at the end, which was creating the corrupt excel file.

Sponsor our Newsletter | Privacy Policy | Terms of Service