URL drops :8888 from localhost
I would try and put the port in your siteUrl config param:

'siteUrl' =&gt; 'http://localhost:8888',


Alternatively you might be able to use this though haven't tested it (I believe the php server variable uses the server name &amp; port number):

'localhost' =&gt; array(
    'siteUrl' =&gt; 'http://'.$_SERVER['HTTP_HOST'],
    'devMode' =&gt; true,
    'cacheMethod' =&gt; 'file'
)