Ever since I added a .bash_profile on my Mac to point to a fresher version of PHP in MAMP, I've noticed my PHP changes take a long time to show in the browser localhost. It's absolutely killing me! I added the bash profile so I could install Laravel 4. Any fixes out there?
Asked
Active
Viewed 2,305 times
3
-
Do you mean that your pages are now slow to load, or that load times are fine but your changes don't appear in your browser for some time? – Oct 09 '13 at 20:15
-
Load times are great. But changes take a few seconds to show. Refreshes don't speed anything up, it literally takes seconds, I can refresh a dozen times in a second and nothing happens. – rpasillas Oct 09 '13 at 20:16
-
hold shift and hit refresh – cmorrissey Oct 09 '13 at 20:17
-
It's possible that the caching parameters in your new MAMP are different. You can possibly fix that in httpd.conf, or .htaccess. That's my best guess. – Oct 09 '13 at 20:18
-
shift + CMD + R, didn't work. The problem feels like it's something in my PHP installation. – rpasillas Oct 09 '13 at 20:20
-
I don't know if the key command works, holding shift while clicking the actual button does a hard refresh, reloading all resources on the page even ones which were previously cached – cmorrissey Oct 09 '13 at 20:25
-
1After upgrading php to 5.5 in MAMP, for some obscure reason, OPCache is enabled by default. This makes the server return cached versions of pages instead of the newer versions (with your changes). I followed [instructions from this thread](http://stackoverflow.com/a/19130992/1200166) to disable OPCache. – rantebi Feb 03 '14 at 08:27
3 Answers
4
Comment out the OPcache in your php.ini files.
/Applications/MAMP/conf/php5.5.3/php.ini
[OPcache]
;zend_extension="/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/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

Brandon J Brotsky
- 523
- 4
- 15
-
1This should be the accepted answer. Otherwise you can just set `opcache.enable` to 0, that'll also disable the opcache. – tyteen4a03 Apr 24 '15 at 06:06
1
Found a solution. The problem with my slow PHP was the version I was using, 5.5.3. Once I switched MAMP to 5.2.17 everything started working as expected.

rpasillas
- 97
- 6