{"id":473,"date":"2025-03-25T08:53:56","date_gmt":"2025-03-25T01:53:56","guid":{"rendered":"https:\/\/megadump.ru\/?p=473"},"modified":"2025-03-25T23:48:03","modified_gmt":"2025-03-25T16:48:03","slug":"%d1%87%d1%82%d0%be-%d1%82%d0%b0%d0%ba%d0%be%d0%b5-php-opcache-%d0%b8-%d0%b7%d0%b0%d1%87%d0%b5%d0%bc-%d0%be%d0%bd-%d0%bd%d1%83%d0%b6%d0%b5%d0%bd","status":"publish","type":"post","link":"https:\/\/phpha.ru\/?p=473","title":{"rendered":"\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 PHP OPcache \u0438 \u0437\u0430\u0447\u0435\u043c \u043e\u043d \u043d\u0443\u0436\u0435\u043d"},"content":{"rendered":"\n<p><strong>PHP OPcache<\/strong> \u2014 \u044d\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f PHP, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434 PHP-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d OPcache?<\/h2>\n\n\n\n<p>\u041a\u043e\u0433\u0434\u0430 PHP-\u0441\u043a\u0440\u0438\u043f\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 PHP \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0447\u0438\u0442\u0430\u0435\u0442 \u043a\u043e\u0434, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0435\u0433\u043e \u0432 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434 (opcode), \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435. OPcache \u0440\u0435\u0448\u0430\u0435\u0442 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u0423\u0441\u043a\u043e\u0440\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 PHP-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432<\/strong> \u2013 \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u0434 \u0443\u0436\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438.<\/li>\n\n\n\n<li><strong>\u0421\u043d\u0438\u0436\u0430\u0435\u0442 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440<\/strong> \u2013 \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435.<\/li>\n\n\n\n<li><strong>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/strong> \u2013 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0434\u043b\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u043e\u0432.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u041a\u0430\u043a \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c OPcache?<\/h2>\n\n\n\n<p>\u0415\u0441\u043b\u0438 PHP \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, OPcache, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0443\u0436\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d. \u0415\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 <code>php.ini<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>opcache.enable=1\nopcache.memory_consumption=128\nopcache.max_accelerated_files=10000\nopcache.validate_timestamps=1\nopcache.revalidate_freq=60\n<\/code><\/pre>\n\n\n\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/strong> \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>validate_timestamps=1<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 OPcache \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u0432 <code>revalidate_freq<\/code>. \u0415\u0441\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <code>validate_timestamps=0<\/code>, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u0434\u0435 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f (\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a PHP).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u041a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 OPcache?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435: <code>php -i | grep opcache<\/code><\/li>\n\n\n\n<li>\u0421\u043e\u0437\u0434\u0430\u0442\u044c PHP-\u0441\u043a\u0440\u0438\u043f\u0442 \u0441 <code>phpinfo();<\/code> \u0438 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0435\u0433\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">\u041a\u043e\u0433\u0434\u0430 \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c OPcache?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0412\u0441\u0435\u0433\u0434\u0430, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 <strong>\u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 PHP<\/strong> (Apache, Nginx + PHP-FPM \u0438 \u0442. \u0434.).<\/li>\n\n\n\n<li>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0434\u043b\u044f <strong>CMS<\/strong> (WordPress, Joomla, Drupal) \u0438 <strong>\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432<\/strong> (Laravel, Symfony, Yii).<\/li>\n\n\n\n<li>\u041c\u0435\u043d\u0435\u0435 \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0432 \u0441\u0440\u0435\u0434\u0430\u0445 \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u043a\u043e\u0434\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438).<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>PHP OPcache \u2014 \u044d\u0442\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f PHP, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043a\u044d\u0448\u0438\u0440\u0443\u0435\u0442 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434 PHP-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[103],"class_list":["post-473","post","type-post","status-publish","format-standard","hentry","category-web","tag-opcache"],"_links":{"self":[{"href":"https:\/\/phpha.ru\/index.php?rest_route=\/wp\/v2\/posts\/473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phpha.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phpha.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phpha.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phpha.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=473"}],"version-history":[{"count":4,"href":"https:\/\/phpha.ru\/index.php?rest_route=\/wp\/v2\/posts\/473\/revisions"}],"predecessor-version":[{"id":479,"href":"https:\/\/phpha.ru\/index.php?rest_route=\/wp\/v2\/posts\/473\/revisions\/479"}],"wp:attachment":[{"href":"https:\/\/phpha.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phpha.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phpha.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}