Home > Backend Development > PHP Tutorial > php code caching problem

php code caching problem

WBOY
Release: 2016-07-29 09:03:12
Original
1553 people have browsed it

The project uses the php+nginx environment to run. Every time the code is modified, it takes a while for it to take effect, which is very annoying.

I happened to be free today, so I started to solve it. The main reason is that php caches opcodes by default.

By looking at the display results of phpinfo(), we found that there is an expiration time configuration in ZendOpcache - opcache.revalidate_freq, the default value is 60.

I opened php.ini, found opcache.revalidate_freq, and changed the value to 1 (the reason why it is not changed to 0 is to prevent opcode from being regenerated every time it is run, which will cause PHP to be less efficient when performing intensive operations, so it was changed to 1 Enough to meet my development needs)

Respect the originality, attach the link: http://www.oschina.net/question/123129_221115

The above has introduced the problem of PHP code caching, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template