Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MAMP time between seeing live changes

Tags:

php

macos

mamp

I'm using MAMP server and wondering why changes I make to the PHP files are not instantaneously displayed when I page refresh (in browser). Is there a way to set this up? There are no caching settings on MAMP. Either I have to wait 20 seconds or stop and restart the server.

like image 900
zebapy Avatar asked Sep 29 '13 14:09

zebapy


People also ask

How do I refresh MAMP?

Here's the solution that worked for me: Go to preferences in MAMP, and change the Apache Port to 80, and the MYSQL port to 3306, then restart the server and try loading your PHP.

Why is MAMP used by some Web developers?

The main reason people use MAMP is to be able to run PHP applications on their local machines.

Is MAMP paid?

MAMP comes free of charge, and is easily installed.


1 Answers

The solution is to comment out lines in the php.ini file which can be found in /MAMP Directory/bin/php/php5.5.3/conf/php.ini

Comment out Opcache:

[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 

Documentation (yes it started in 5.5):

http://www.php.net/manual/en/intro.opcache.php

like image 126
Luc Franken Avatar answered Sep 29 '22 19:09

Luc Franken