Sometimes Stuff is Stuff
So I am upgrading a 4.7.x site to 5.2 and I managed to get everything working great till I tried to create the custom theme. I got the blank Drupal screen of death and the following in the httpd error log as soon as I turned up the new theme ...
Call to undefined function module_exist() in /Library/WebServer/Documents/rms/includes/common.inc(1342) : eval()'d code on line 2
So I go crazy ... I pour over the code in the common.inc, increase the php memory, created the new theme over and over again, and the more I messed with it the worse it got till even the admin area was the white screen of death ... WHOA!
So instead of searching for solutions on drupal.org, I did what I should have done in the beginning... searched for the problem. And lo and behold, this little gem pops up.
I think at least one of your blocks is using this function. Try searching boxes and blocks tables in your database for module_exist. If you can find then replace it with module_exists.
OMG, I hadn't thought to take the error message literally. I thought it was pointing to some esoteric mystery within php. When all along it was simply saying that this function is not defined anywhere.
Seems the function name had changed from version 4.7 to 5.2. And it had been hard coded in to several blocks by a module that was not upgraded to 5.x ... so of course the specialized code missed the change. Wow!
Too funny ... so remember ... sometimes stuff is just stuff!
And ... search drupal.org for the problem first, not your supposed solution.

Use the following sql to fix this particular problem.
update `blocks`
set pages=replace(pages, "module_exist", "module_exists")
where `pages` like '%module_exist%'