You have copied the modules.php file into the wrong place. The file that it should overwrite is in templates/system/html/modules.php
It should NOT overwrite the modules.php file in your site template html folder, that is specific to your template and of course replacing it with a completely different file distributed with our module is going to crash your site. You need to go back to your original modules.php file, looking at it you should not have any problems with it anyway because it always includes the test to see if there is any module content before outputting the module. Therefore there was never any need to replace it.