Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress Local WordPress Development Local WordPress Development Installing a Local Web Server on a Mac

valeriuv
valeriuv
20,999 Points

Why don't changes get reflected in the browser instantly?

My WP installation on Mac OS X Yosemite has a bit of a hiccup - sometimes the changes don't get updated instantly after I save the theme files. I have to click around or wait for about 30 seconds then the changes are shown in the browser. Any suggestions?

Thanks!

Mike Rogers
Mike Rogers
5,280 Points

Could you create a file with the contexts

<?php 
phpinfo();
?>

And copy and paste the results into the forum? According to this bug report the opcache might have changed in Yosemite.

7 Answers

valeriuv
valeriuv
20,999 Points

Didn't help either - I commented out all OPCache lines.

I changed the PHP version from 5.5 to 5.2.17 and now it works - but a plugin requires a higher PHP version, so this is not a long-term solution.

This sounds more like a machine problem. Where do you have your sites folder located on your computer?

valeriuv
valeriuv
20,999 Points

The files are under Users > My_Username > Google Drive > Sites

valeriuv
valeriuv
20,999 Points

Is there anybody that can help with this issue?

Mike Rogers
Mike Rogers
5,280 Points

Yosemite enables Zend OPcache (It's marked as enabled in your phpinfo) for PHP code, edit your php.ini file to disable it.

valeriuv
valeriuv
20,999 Points

Mike, I changed the value of "opcache.enable_cli" from 1 to 0 in both php.ini and php.ini.temp files from Macintosh HD ▸ Applications ▸ MAMP ▸ bin ▸ php ▸ php5.5.3, but the problem persists. I also moved the whole folder with files from my Google Drive and placed it in my user's main directory.

[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=0

Still looking for an answer.

valeriuv
valeriuv
20,999 Points

After looking through documentation, I added:

opcache.enable=0

but still no luck.

Use prepros. It's perfect it's even better than WAMP and XAMPP and it updates automatically.

valeriuv
valeriuv
20,999 Points

I noticed now it takes exactly 1 minute for the changes to take effect. It doesn't seem to matter if I click around or not.

Did you try to delete your browsers cache? That sometimes help.

valeriuv
valeriuv
20,999 Points

Cleaned the cache just now. Doesn't help.

Ich glaub diese Loesung funkioniert wird.