Stop caching for PHP 5.5.3 in MAMP

前端 未结 9 1250
孤城傲影
孤城傲影 2020-11-27 10:03

Installed MAMP on a new Macbook with PHP 5.5.3.

Reload and refresh do nothing. Still nothing. Google around for a few minutes trying to find out what is wrong, come

相关标签:
9条回答
  • 2020-11-27 10:20

    Oh man am I glad I found this thread! I was pulling my hair out! I just upgraded MAMP yesterday and didn't notice this caching issue until today while working on a project. Thought I was losing my mind. I just changed "/Applications/MAMP/conf/php5.5.3/php.ini" very bottom of file opcache.enable=0

    0 讨论(0)
  • 2020-11-27 10:21

    I added opcache_reset(); in my main PHP to stop this caching.

    Removing it from php5.5.3/conf/php.ini did nothing for me.

    Edit

    Turns out there also is a /Applications/MAMP/bin/php/php5.5.3/conf/php.ini. It works if I comment it out there.

    0 讨论(0)
  • 2020-11-27 10:21

    Edit "/Applications/MAMP/conf/php5.5.3/php.ini", and search for [OPcache] and add this code under it directly:

    opcache.enable=0
    

    This will disable opcache in when use PHP in MAMP server.

    0 讨论(0)
  • 2020-11-27 10:23

    It was painful spending around 1 hour trying to figure out what could it be.

    I just added this at the end of the code and restart MAMP.

      opcache.revalidate_freq=0
      opcache_reset();
    
    0 讨论(0)
  • 2020-11-27 10:25

    Disable OPCache

    MAMP now turns on OPCache by default, you can disable it by editing your php.ini file. Make sure you edit the correct php.ini.

    I was running into the same problem myself. MAMP with PHP version 5.5.3 runs OPcache by default, but you can't turn it off in the GUI like you can with the older PHP version 5.2.17. You have to manually comment out all the OPcache lines at the end of the php.ini file (MAMP/bin/php/[version]/conf/php.ini) and make sure to stop and start the servers for the changes to take effect.

    I updated the URI, the changes can be reflective by also changing /conf/ under the php folder, but it seems MAMP will ignore these after restart.

    0 讨论(0)
  • 2020-11-27 10:27

    1) in /Applications/MAMP/bin/php/php5.5.3/conf/php.ini
    2) set opcache.revalidate_freq=0
    3) restart MAMP

    0 讨论(0)
提交回复
热议问题