I have been doing some investigation and I think I have found out the cause of the error!
By creating a new document and copying bits, slowly into the new file, i was able to find out what coding was causing the 500 error, i used search.php. ( modified )... the errror was created by
require PUN_ROOT.'footer.php';
Doing further investegations into the footer.php file the code causing the problem is
on line 210. It is the last command before exit($tpl_main). If I comment out the db$->close; the page displays.
Could it be that the database is already closed? How can I check this? Is it a configuration of MySQL so that it closes on a commit of a transaction?
Sorry. Unactive due to personal life.