since it does not happen every time on the same page, it sounds like a problem in the install of the local PHP / MySQL server.
maybe a port conflict with another program trying to use the same port as the apache web server (default is 80) or the MySQL Server (default is 3306)
But it's impossible to tell.