Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WordPress用ローカル環境構築ツール 「Local by Flywheel」を使ってみて

kassy
February 11, 2017

WordPress用ローカル環境構築ツール 「Local by Flywheel」を使ってみて

kassy

February 11, 2017
Tweet

More Decks by kassy

Other Decks in Technology

Transcript

  1. ϩʔΧϧ؀ڥΛҰׅ؅ཧ αʔόʔɺPHPͷόʔδϣϯ੾Γସ͑ SSL SSH BluePrints ΤΫεϙʔτɺΠϯϙʔτ Xdebug Local by Flywheelͷػೳ

    ෳ਺ͷϩʔΧϧ؀ڥΛಉ࣌ʹىಈɺγϟοτμ΢ϯ ApacheͱnginxΛ੾Γସ͑ɻPHP5.6ɺ7.03ͳͲɺෳ਺ͷPHPόʔδϣϯΛ੾Γସ͑ httpsͰͷঢ়ଶΛϓϨϏϡʔ rootΞΫηε΋Մ ηοτΞοϓͨ͠WordPressͷঢ়ଶΛςϯϓϨʔτԽɻαΠτͷΫϩʔϯΛ࡞੒ɻ σʔλϕʔε͝ͱσʔλΛzipΞʔΧΠϒԽɻΠϯϙʔτ͢Ε͹͙͢ʹ෮׆ɻ PHPStormͰͷσόοΫઃఆΛϘλϯͻͱͭͰɻ
  2. ؔ࿈ϑΝΠϧͷ৔ॴ ϗʔϜσΟϨΫτϦ/.docker/machine/machines/local-by-flywheel Ծ૝ϚγϯϑΝΠϧ ઃఆϑΝΠϧ ϗʔϜσΟϨΫτϦ/Library/Application Support/Local by Flywheel Ծ૝Ϛγϯ͕ىಈ͠ͳ͘ͳΔ͜ͱ͕Կճ͕ى͜Γ·ͨ͠ɻ όοΫΞοϓ͍ͯͨؔ͠࿈ϑΝΠϧΛ্ॻ͖ίϐʔͨ͠ΒىಈͰ͖ΔΑ͏ʹɻ

    ※.dockerͱLibrary͸Ӆ͠ϑΥϧμʹͳ͍ͬͯ·͢ɻ Ӆ͠ϑΥϧμΛදࣔͤ͞ΔΞϓϦΛ࢖͏͔ɺλʔϛφϧͰҎԼͷίϚϯυΛଧͭͱදࣔͰ͖·͢ɻ defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder όοΫΞοϓ͸͜·Ίʹ…
  3. • wp-contentϑΥϧμ • σʔλϕʔε(WP-CLIɺphpMyAdminͳͲͰ.sqlϑΝΠϧΛΤΫεϙʔτ) Local by FlywheelͰ࡞੒ͨ͠αΠτʹΠϯϙʔτ ଞͷϩʔΧϧ؀ڥ͔ΒσʔλΛΤΫεϙʔτ σʔλͷҠߦ •

    wp-contentϑΥϧμ • σʔλϕʔε(WP-CLIɺadminerͳͲͰ.sqlϑΝΠϧΛΠϯϙʔτ) σʔλϕʔεͷυϝΠϯ໊Λॻ͖׵͑ WP-CLIͷwp search-replaceɺDATABASE SEARCH AND REPLACE SCRIPT IN PHPͳͲΛ࢖༻ old-site.dev → new-site.dev HOSTSϑΝΠϧΛฤू(ඞཁͳ৔߹ͷΈ) /private/etc/hosts Ҏલͱಉ͡υϝΠϯ໊Λ࢖༻͢Δ৔߹͸چϩʔΧϧ؀ڥͷهड़෦෼Λ࡟আ
  4. https://github.com/welaika/wordmove Movefileͷฤू local: vhost: "http://wordpress.dev" wordpress_path: "~/Local Sites/ wordpress database:

    name: "local" user: "root" password: "root" ؅ཧը໘ͰDBͷ৘ใΛࢀরɻϙʔτ΋هड़͢Δɻ ϦϞʔταʔόʔͷ৘ใ΋هड़͢Δɻ αϯϓϧΛݩʹlocalͷMovefileͷ֤߲໨Λهड़ɻ
  5. WordMoveͷ࣮ߦ ϦϞʔτ͔ΒσʔλϕʔεɺίϯςϯπΛऔಘ wordmove pull -d -u ϩʔΧϧ͔Β͔ΒςʔϚΛΞοϓϩʔυ wordmove push -t

    WordPressຊମͷσΟϨΫτϦʹҠಈ WordMoveίϚϯυ cd /Users/Ϣʔβʔ໊/Local\ Sites/αΠτͷϧʔτσΟϨΫτϦ/app/public