My best guess is that the connection information is wrong for the live database. There is no reason why it wouldn't work on that server version.
Make sure the connection information is correct for your live database... you can add this code before the error after line 23:
<?php
var_dump($localhost);
die();
?>
That will tell you if the connection is working.