{"id":209,"date":"2024-10-04T16:00:00","date_gmt":"2024-10-04T07:00:00","guid":{"rendered":"https:\/\/miginihitsuji.com\/prog\/?p=209"},"modified":"2026-01-17T13:07:14","modified_gmt":"2026-01-17T04:07:14","slug":"wordpress-wp-env","status":"publish","type":"post","link":"https:\/\/miginihitsuji.com\/prog\/wordpress-wp-env\/","title":{"rendered":"wp-env\u3067WordPress\u30c6\u30fc\u30de\u306e\u30ed\u30fc\u30ab\u30eb\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b"},"content":{"rendered":"\n<p>WordPress\u516c\u5f0f\u304c\u30ea\u30ea\u30fc\u30b9\u3057\u3066\u3044\u308b\u3001@wordpress\/env\u30d1\u30c3\u30b1\u30fc\u30b8\uff08wp-env\uff09\u3092\u4f7f\u7528\u3057\u3066WordPress\u30c6\u30fc\u30de\u306e\u30ed\u30fc\u30ab\u30eb\u958b\u767a\u74b0\u5883\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u65b9\u6cd5\uff08\u203bMac\u7528\uff09\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u524d\u63d0\u6761\u4ef6<\/h2>\n\n\n\n<p>\u4ee5\u4e0b\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.docker.com\/ja-jp\/\" target=\"_blank\" rel=\"noreferrer noopener\">Docker<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/nodejs.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">Node.js<\/a><\/li>\n<\/ul>\n\n\n\n<p>Node.js\u306f\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u3082\u3067\u304d\u308b\u3068\u4fbf\u5229\u3067\u3059\u3002\u4e0b\u8a18\u3092\u53c2\u8003\u306b\u3069\u3046\u305e\uff08\u203bMac\u7528\uff09<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/miginihitsuji.com\/prog\/wp\/wp-content\/uploads\/nodejs-anyenv-nodenv-300x158.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/miginihitsuji.com\/prog\/nodejs-anyenv-nodenv\/\">nodenv\u3067Node.js\u3092\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u6bce\u306b\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u7ba1\u7406\u3059\u308b\uff08anyenv\u3092\u4f7f\u7528\uff09<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u6bce\u306bNode.js\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u7570\u306a\u308b\u3053\u3068\u306f\u3088\u304f\u3042\u308b\u3053\u3068\u3067\u3001\u5834\u9762\u306b\u5fdc\u3058\u3066\u4f7f\u7528\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u5207\u308a\u66ff\u3048\u3089\u308c\u308b\u74b0\u5883\u306f\u5fc5\u9808\u3068\u3044\u3048\u307e\u3059\u3002\u305d\u3057\u3066\u3001Node.js\u3060\u3051\u306b\u3068\u3069\u307e&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<h2 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p>\u516c\u5f0f\u30b5\u30a4\u30c8\u3092\u53c2\u8003\u306b\u3059\u3059\u3081\u307e\u3059\u3002<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -external\" data-type=\"type3\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">Japanese Team<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/s.w.org\/images\/home\/wordpress-default-ogimage.png\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/ja.wordpress.org\/team\/handbook\/block-editor\/reference-guides\/packages\/packages-env\/\" target=\"_blank\" rel=\"noopener noreferrer\">@wordpress\/env<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">wp-env\u00a0\u3092\u4f7f\u7528\u3057\u3066\u30d7\u30e9\u30b0\u30a4\u30f3\u3084\u30c6\u30fc\u30de\u306e\u30d3\u30eb\u30c9\u7528\u3068\u30c6\u30b9\u30c8\u7528\u306e WordPress \u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3092\u2026<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<p>WordPress\u74b0\u5883\u3092\u3064\u304f\u308a\u305f\u3044\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff08\u3053\u3053\u3067\u306f <span class=\"swl-bg-color has-swl-pale-01-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">wp-env-test<\/span><\/span> \u3068\u3057\u307e\u3059\uff09\u306b\u79fb\u52d5\u3057\u3001\u30b3\u30de\u30f3\u30c9\u3067\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code># \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3044\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\n$ cd \/your-path\/wp-env-test\n\n# \u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\n$ npm i @wordpress\/env --save-dev<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u74b0\u5883\u306e\u958b\u59cb\u3001\u305d\u3057\u3066\u8d77\u52d5<\/h2>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u74b0\u5883\u3092\u958b\u59cb\u3057\u307e\u3059\u3002\u521d\u56de\u306f\u3084\u3084\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>$ wp-env start\n\u26a0 Warning: could not find a .wp-env.json configuration file and could not determine if &#39;\/your-path\/wp-env-test&#39; is a WordPress installation, a plugin, or a theme.\nWordPress development site started at http:\/\/localhost:8888\nWordPress test site started at http:\/\/localhost:8889\nMySQL is listening on port 51156\nMySQL for automated testing is listening on port 51231\n\n \u2714 Done! (in 73s 129ms)<\/code><\/pre><\/div>\n\n\n\n<p>Done! \u304c\u8868\u793a\u3055\u308c\u305f\u3089\u6210\u529f\u3067\u3059\u3002<\/p>\n\n\n\n<p><span class=\"swl-bg-color has-swl-pale-01-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">.wp-env.json<\/span><\/span> \u3092\u6e96\u5099\u3057\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u8b66\u544a\u3092\u53d7\u3051\u3064\u3064\u3082\u3001\u6700\u4f4e\u9650\u306eWordPress\u30ed\u30fc\u30ab\u30eb\u958b\u767a\u74b0\u5883\u304c\u51fa\u6765\u4e0a\u304c\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u30d6\u30e9\u30a6\u30b6\u3067\u3001<a href=\"http:\/\/localhost:8888\">http:\/\/localhost:8888<\/a> \u3092\u958b\u304f\u3068WordPress\u306e\u30b5\u30a4\u30c8\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u7ba1\u7406\u753b\u9762\u306f\u3001<a href=\"http:\/\/localhost:8888\/wp-admin\/\">http:\/\/localhost:8888\/wp-admin\/<\/a> \u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001\u4ee5\u4e0b\u3067\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u307e\u3059\u3002<br>Username\uff1aadmin<br>Password\uff1apassword<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u74b0\u5883\u306e\u505c\u6b62<\/h2>\n\n\n\n<p>\u505c\u6b62\u3082\u7c21\u5358\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>$ wp-env stop\n\u2714 Stopped WordPress. (in 13s 2ms)<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u30ab\u30b9\u30bf\u30de\u30a4\u30ba<\/h2>\n\n\n\n<p>\u7206\u901f\u3067\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u304c\u3067\u304d\u3042\u304c\u308a\u307e\u3057\u305f\u3002\u3042\u3068\u306f\u3001\u958b\u767a\u3057\u3084\u3059\u3044\u3088\u3046\u306b <span class=\"swl-bg-color has-swl-pale-01-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">.wp-env.json<\/span><\/span> \u3092\u7528\u610f\u3057\u3066\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u3066\u304a\u304f\u3068\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u79c1\u306e\u74b0\u5883\u3092\u5c11\u3057\u3054\u7d39\u4ecb\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-json\" data-file=\".wp-env.json\" data-lang=\"JSON\"><code>{\n  &quot;core&quot;: &quot;https:\/\/ja.wordpress.org\/wordpress-6.6.2-ja.zip&quot;,\n  &quot;plugins&quot;: [\n    &quot;https:\/\/downloads.wordpress.org\/plugin\/advanced-custom-fields.6.3.6.zip&quot;,\n    &quot;https:\/\/downloads.wordpress.org\/plugin\/all-in-one-seo-pack.4.7.1.1.zip&quot;,\n    &quot;https:\/\/downloads.wordpress.org\/plugin\/backwpup.4.1.4.zip&quot;,\n    &quot;https:\/\/downloads.wordpress.org\/plugin\/breadcrumb-navxt.7.3.1.zip&quot;,\n    &quot;https:\/\/downloads.wordpress.org\/plugin\/duplicate-page.zip&quot;,\n    &quot;https:\/\/downloads.wordpress.org\/plugin\/siteguard.1.7.8.zip&quot;\n    &quot;https:\/\/downloads.wordpress.org\/plugin\/wp-multibyte-patch.2.9.zip&quot;,\n    &quot;https:\/\/downloads.wordpress.org\/plugin\/wp-pagenavi.2.94.1.zip&quot;\n  ],\n  &quot;config&quot;: {\n    &quot;WP_DEBUG&quot;: true\n  },\n  &quot;themes&quot;:[&quot;.&quot;],\n  &quot;mappings&quot;: {\n    &quot;wp-content\/uploads&quot;: &quot;.\/wordpress\/uploads&quot;,\n    &quot;wp-content\/themes&quot;: &quot;.\/wordpress\/themes&quot;,\n    &quot;wp-content\/plugins&quot;: &quot;.\/wordpress\/plugins&quot;,\n    &quot;sql&quot;: &quot;.\/sql&quot;\n  }\n}<\/code><\/pre><\/div>\n\n\n\n<p>plugins\u306b\u306f\u3001\u79c1\u304c\u3044\u3064\u3082\u4f7f\u7528\u3059\u308b\u5b9a\u756a\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u66f8\u3044\u3066\u3044\u307e\u3059\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304b\u3089\u6709\u52b9\u5316\u307e\u3067\u3055\u308c\u308b\u306e\u3067\u4fbf\u5229\u3067\u3059\u3002\u307e\u305f\u3001\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u30d5\u30a1\u30a4\u30eb\u3001\u30c6\u30fc\u30de\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u30de\u30c3\u30d4\u30f3\u30b0\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>DB\u306e\u5171\u6709\u304c\u5fc5\u8981\u306a\u5834\u5408\u306b\u5099\u3048\u3066sql\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3082\u30de\u30c3\u30d4\u30f3\u30b0\u306e\u5bfe\u8c61\u306b\u3057\u3066\u3044\u307e\u3059\u3002wp-env\u306bwp-cli\u3082\u5165\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u4f7f\u3063\u3066\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u3057\u3001Git\u3067\u5171\u6709\u3067\u304d\u308b\u305d\u3046\u306a\u306e\u3067\uff08\u79c1\u306f\u3072\u3068\u308a\u958b\u767a\u306a\u306e\u3067\u3042\u308c\u3067\u3059\u304c\uff09<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code># DB\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\n$ npm run wp-env run cli wp db export sql\/wpenv.sql\n\n# DBurl\u66f8\u304d\u63db\u3048\n$ npm run wp-env run cli wp search-replace &#39;http:\/\/localhost:8888&#39; &#39;https:\/\/custom-dev-domain&#39;\n\n# DB\u30a4\u30f3\u30dd\u30fc\u30c8\nnpm run wp-env run cli wp db import sql\/wpenv.sql<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u3042\u3068\u304c\u304d<\/h2>\n\n\n\n<p>\u5b9f\u969b\u306b\u306f\u3001\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u30d3\u30eb\u30c9\u30c4\u30fc\u30eb\uff08\u79c1\u306fVite\u63a8\u3057\uff09\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u30c6\u30fc\u30de\u5236\u4f5c\u306e\u5834\u5408\u3001\u9759\u7684\u3067\u3064\u304f\u3063\u3066\u304b\u3089WordPress\u5316\u3059\u308b\u3053\u3068\u304c\u591a\u3044\u306e\u3067\u3001\u305d\u306e\u6d41\u308c\u3082\u8003\u616e\u3057\u3001\u30d3\u30eb\u30c9\u524d\u306e\u4f5c\u696d\u30d5\u30a1\u30a4\u30eb\u3092src\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u7f6e\u304d\u3001\u51fa\u529b\u306bdist\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3001WordPress\u30c6\u30fc\u30de\u5316\u306bwordpress\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u7528\u610f\u3057\u3066\u3001\u305d\u306ewordpress\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30de\u30c3\u30d4\u30f3\u30b0\u3059\u308b\u3068\u3044\u3063\u305f\u5177\u5408\u3067\u3059\u3002\u3053\u306e\u3042\u305f\u308a\u306e\u8a73\u7d30\u306f\u3001\u307e\u305f\u5225\u306e\u6a5f\u4f1a\u306b\u3054\u7d39\u4ecb\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress\u516c\u5f0f\u304c\u30ea\u30ea\u30fc\u30b9\u3057\u3066\u3044\u308b\u3001@wordpress\/env\u30d1\u30c3\u30b1\u30fc\u30b8\uff08wp-env\uff09\u3092\u4f7f\u7528\u3057\u3066WordPress\u30c6\u30fc\u30de\u306e\u30ed\u30fc\u30ab\u30eb\u958b\u767a\u74b0\u5883\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u65b9\u6cd5\uff08\u203bMac\u7528\uff09\u3067\u3059\u3002 \u524d\u63d0\u6761\u4ef6 \u4ee5\u4e0b\u304c\u5fc5\u8981\u3067\u3059\u3002  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":224,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[26],"tags":[29,11,28],"class_list":["post-209","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cms-wordpress","tag-docker","tag-wordpress","tag-wp-env"],"_links":{"self":[{"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/comments?post=209"}],"version-history":[{"count":12,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/posts\/209\/revisions"}],"predecessor-version":[{"id":223,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/posts\/209\/revisions\/223"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/media\/224"}],"wp:attachment":[{"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/media?parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/categories?post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/miginihitsuji.com\/prog\/wp-json\/wp\/v2\/tags?post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}