title: MAMP localhost has suddenly become very slow
body: <p>I have been searching around for answers to this. I saw the below answers:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/18537887/mamp-localhost-resolving-very-slowly">Mamp localhost resolving very slowly</a></li>
  <li><a href="https://stackoverflow.com/questions/5690269/disabling-chrome-cache-for-website-development">Disabling Chrome cache for website development</a></li>
  <li><a href="https://stackoverflow.com/questions/8452614/mamp-reloading-pages-is-very-slow">MAMP: reloading pages is very slow</a></li>
  </ul>
  
  <p>Here is my etc/hosts file (not, I couldn't change this to remove <code>::1 localhost</code>, and just have <code>::1 127.0.0.1  localhost</code>.</p>
  
  <p><a href="https://i.stack.imgur.com/TwkzL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TwkzL.png" alt="enter image description here"></a></p>
  
  <p>I then commented out the opcache lines in my php.ini file so it looks like:</p>
  
  <pre><code>[OPcache]
  ;zend_extension="/Applications/MAMP/bin/php/php5.6.10/lib/php/extensions/no-debug-non-zts-20131226/opcache.so"
  ;  opcache.memory_consumption=128
  ;  opcache.interned_strings_buffer=8
  ;  opcache.max_accelerated_files=4000
  ;  opcache.revalidate_freq=60
  ;  opcache.fast_shutdown=1
  ;  opcache.enable_cli=1
  </code></pre>
  
  <p>Previously the opcache.memory_consumption etc. lines were not commented out.</p>
  
  <p>I then changed my serverName in httpd.conf to this:</p>
  
  <p>...</p>
  
  <pre><code># If your host doesn't have a registered DNS name, enter its IP address here.
  #
  ServerName 127.0.0.1
  #localhost:80
  ....
  </code></pre>
  
  <p>So, how can I get my localhost on MAMP to stop loading my php file so slow? About 3 weeks ago this same file was working fine and printing messages to the webpage with my error messages etc while doing curl requests. However, for some reason, now it is super slow. A friend on another computer is running my exact script on his server and it runs fine.</p>
  
  <p>Finally, when I open up my inspect element on Chrome (I also disabled the cache before pressing Cmd+R to reload the page), I started with this:</p>
  
  <p><a href="https://i.stack.imgur.com/pkXJW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pkXJW.png" alt="enter image description here"></a></p>
  
  <p>And ended with this 13 mins later, where text did print to the webpage but not in the regular way as it did before (I have a <code>print_r</code> function in the php file that printed out line by line whenever one curl request was made to an API, and it would print things line by line onto the webpage) :</p>
  
  <p><a href="https://i.stack.imgur.com/ww0F9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ww0F9.png" alt="enter image description here"></a></p>
  
  <p>What can I do to prevent this? What has happened to cause localhost suddenly start messing up?</p>