{"id":3418,"date":"2018-07-09T12:36:00","date_gmt":"2018-07-09T03:36:00","guid":{"rendered":"http:\/\/soundengine.jp\/wordpress\/tips\/?p=3418"},"modified":"2018-07-10T15:40:56","modified_gmt":"2018-07-10T06:40:56","slug":"wordpress%e3%81%a7allowed-memory-size-of-bytes-exhausted-tried-to-allocate-bytes%e3%81%ae%e3%82%a8%e3%83%a9%e3%83%bc","status":"publish","type":"post","link":"https:\/\/soundengine.jp\/wordpress\/tips\/try\/3418\/","title":{"rendered":"WordPress\u3067allowed memory size of bytes exhausted (tried to allocate bytes)\u306e\u30a8\u30e9\u30fc"},"content":{"rendered":"<p>WordPress\u3092\u4f7f\u3063\u3066\u308b\u3068\u305f\u307e\u306b\u300callowed memory size of bytes exhausted (tried to allocate bytes)\u300d\u307f\u305f\u3044\u306a\u30a8\u30e9\u30fc\u304c\u3067\u308b\u3053\u3068\u304c\u3042\u308b\u3002<\/p>\n<p>\u30a8\u30e9\u30fc\u304c\u8d77\u304d\u305f\u5834\u6240\u306f\u3001functions.php\u306e5177\u884c\u76ee\u3068\u3044\u3046\u3053\u3068\u3067\u3053\u308c\u3092\u898b\u308b\u3068<\/p>\n<pre>\r\nfunction wp_is_stream( $path ) {\r\n\t$wrappers = stream_get_wrappers();\r\n\t$wrappers_re = '(' . join('|', $wrappers) . ')';\r\n\r\n\treturn preg_match( \"!^$wrappers_re:\/\/!\", $path ) === 1;\r\n}<\/pre>\n<p>\u3053\u3093\u306a\u3053\u3068\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u4e00\u5fdcPHP\u306f\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u3057\u3066\u307f\u305f\u3082\u306e\u306e\u3001\u4f55\u304b\u305d\u308c\u3067\u306f\u89e3\u6c7a\u3057\u306a\u3044\u6a21\u69d8\u3002\u8272\u3005\u8abf\u3079\u3066\u308b\u3068\u3001Windows\u7cfb\u306ePHP?Apache?\u3067\u767a\u751f\u3057\u3066\u308b\u3068\u304b<\/p>\n<p>\u8272\u3005\u898b\u3066\u308b\u3068\u3001<a href=\"https:\/\/core.trac.wordpress.org\/ticket\/43054\">https:\/\/core.trac.wordpress.org\/ticket\/43054<\/a>\u3053\u3053\u3089\u5909\u306b\u4f3c\u305f\u75c7\u72b6\u3089\u3057\u304d\u3082\u306e\u304c\u3001\u3001\u3001\u3053\u308c\u306b\u3088\u308b\u3068stream_get_wrappers\u304c\u3069\u3046\u3082\u30a2\u30b9\u30ad\u30fc\u5916\u306e\u6587\u5b57\u3092\u8fd4\u3059\u3068\u3044\u3046\u3053\u3068\u3089\u3057\u3044\u3001\u3001\u3001<\/p>\n<p>\u3064\u307e\u308b\u3068\u3053\u308d\u3001stream_get_wrappers()\u3067\u8fd4\u3063\u3066\u304f\u308b\u5024\u304c\u5c11\u3005\u304a\u304b\u3057\u3044\u5834\u5408\u304c\u3042\u3063\u3066\u3001\u305d\u306e\u5f8c\u306ejoin\u3042\u305f\u308a\u3067\u3069\u3046\u3082\u6587\u5b57\u5217\u7d42\u7aefNULL\u307e\u3067\u306e\u30e1\u30e2\u30ea\u78ba\u4fdd\u304c\u5927\u91cf\u306e\u30e1\u30e2\u30ea\u3092\u5fc5\u8981\u3068\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u767a\u751f\u3057\u3066\u3044\u308b\u3088\u3046\u306b\u601d\u3048\u308b\u3002<\/p>\n<p><a href=\"https:\/\/bugs.php.net\/bug.php?id=72451#1484148428\">https:\/\/bugs.php.net\/bug.php?id=72451#1484148428<\/a>\u3053\u3061\u3089\u306b\u89e3\u6c7a\u65b9\u6cd5\uff1f\u3067join\u306estream_get_wrappers\u3064\u304b\u308f\u305a\u56fa\u5b9a\u6587\u5b57\u5217\u3067\u66f8\u3044\u3061\u3083\u3048\u7684\u306a\u306e\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u3068\u308a\u3042\u3048\u305a\u3053\u3093\u306a\u611f\u3058\u306b\u76f4\u3057\u3066\u307f\u305f\u3002<\/p>\n<pre>\r\nfunction wp_is_stream( $path ) {\r\n\/\/\t$wrappers = stream_get_wrappers();\r\n\/\/\t$wrappers_re = '(' . join('|', $wrappers) . ')';\r\n\/\/\tvar_dump( $wrappers_re );\r\n\t$wrappers_re = \"(php|file|glob|data|http|ftp|zip|compress.zlib|https|ftps|phar)\";\r\n\r\n\treturn preg_match( \"!^$wrappers_re:\/\/!\", $path ) === 1;\r\n}<\/pre>\n<p>\u306a\u3093\u304b\u9069\u5f53\u3059\u304e\u308b\u6c17\u3082\u3057\u306a\u3044\u3067\u3082\u306a\u3044\u304c\u3001\u3001\u3001<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u3092\u4f7f\u3063\u3066\u308b\u3068\u305f\u307e\u306b\u300callowed memory size o &hellip; <a href=\"https:\/\/soundengine.jp\/wordpress\/tips\/try\/3418\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[36,35,34],"class_list":["post-3418","post","type-post","status-publish","format-standard","hentry","category-try","tag-php","tag-wordpress","tag-34"],"_links":{"self":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/3418","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/comments?post=3418"}],"version-history":[{"count":9,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/3418\/revisions"}],"predecessor-version":[{"id":3427,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/posts\/3418\/revisions\/3427"}],"wp:attachment":[{"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/media?parent=3418"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/categories?post=3418"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soundengine.jp\/wordpress\/tips\/wp-json\/wp\/v2\/tags?post=3418"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}