2

I have been searching around for answers to this. I saw the below answers:

Here is my etc/hosts file (not, I couldn't change this to remove ::1 localhost, and just have ::1 127.0.0.1 localhost.

enter image description here

I then commented out the opcache lines in my php.ini file so it looks like:

[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

Previously the opcache.memory_consumption etc. lines were not commented out.

I then changed my serverName in httpd.conf to this:

...

# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName 127.0.0.1
#localhost:80
....

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.

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:

enter image description here

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 print_r 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) :

enter image description here

What can I do to prevent this? What has happened to cause localhost suddenly start messing up?

Community
  • 1
  • 1
Dhruv Ghulati
  • 2,976
  • 3
  • 35
  • 51

0 Answers0