PHP Embedded Development Server: Disable Caching

Sometimes I like to use the built-in PHP development server to work with such fast things:

php -S 127.0.0.1:8888

However, I seem to run into serious caching issues from time to time when I need to restart the server to see even simple HTML changes.

I was not able to find any options to disable this or otherwise determine what might cause this frustration.

Note. I usually have Chrome developer tools open with disabling browser caching while I do this. I do not think this is a browser caching problem.

Is there anything I can try?

+4
source share
1 answer

If changing your php scripts does not lead to a change, this can be a problem of caching the operation code, unlike browser caching (browser caching should be easily overridden CTRL-F5or CTRL-R, depending on your OS), this happens when the server pre-compiles your php code to speed up responses.

That was the case with me, so I went in /etc/php5/cli/conf.d/and found a symbolic link to 05-opcache.iniand deleted that symbolic link and restarted the built-in server. The problem that the pages didn't change when I edited the php code was resolved from now on.

+1
source

All Articles