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

phpenv on Mac 難しすぎワロタ

phpenv on Mac 難しすぎワロタ

PHPカンファレンス2020 懇親会LTの発表資料です。
https://phpcon.connpass.com/event/193142/

8e844e43f029ec38e206a464cf4587b3?s=128

Takashi Kanemoto

December 12, 2020
Tweet

Transcript

  1. /28 2020/12/12 #phpcon #࠙਌ձLT @ttskch 1 phpenv on Mac ೉͗͢͠ϫϩλ

  2. /28 2 • ʙ2020/03 
 (ג)ΧϧςοτίϛϡχέʔγϣϯζCTO 
 blog.ttskch.com/thank-you-quartet-communications • 2020/04ʙ

    
 ϑϦʔϥϯεWebΤϯδχΞ 
 https://kannade.jp ͖ͨͭͪʢ໊͋ͩʣ
  3. /28 3 ͖ͨͭͪʢ໊͋ͩʣ • ϦεςΟϯά޿ࠂͷձࣾͰWebαʔϏεΛ࡞ͬͯ·ͨ͠ • CTOͱͯ͠ࡏ੶ͨ͠8೥ؒͰɺࣾһ਺2໊ˠ60໊ɺ 
 ച্ن໛5000ສԁˠ27ԯԁʹ·Ͱ੒௕

  4. /28 4 • ͓ख఻͍ͨ͠ຊʢ2015/12ʣ • Schooߨࢣʢ2018/04ʣ ͖ͨͭͪʢ໊͋ͩʣ ʮGitHubΛ࢖ͬͨσϓϩΠࣗಈԽ࣮ફʯ ʮجຊ͔Β͔ͬ͠ΓֶͿ Symfony2ೖ໳ʯ

  5. /28 5 twitter.com/ ttskch ͋͞ɺ͋ͳͨ΋ࠓ͙͢ϑΥϩʔ͠Α͏ʂ 100% ͍ͯ͠Δ ͍ͯ͠ͳ͍ ϑΥϩϫʔ͞Μ100ਓʹฉ͖·ͨ͠ ͖ͨͭͪΛϑΥϩʔ͍ͯ͠Δʁ

    ͨ ͭ ͖ ͪ ׬શແྉʂ ·͞ʹ໊ݴ੡଄ػ ਓੜͰେ੾ͳ͜ͱ͸ 
 ͢΂͖͔ͯͨͭͪΒڭΘͬͨ ͖ͨͭͪΛϑΥϩʔͨ͠Β 
 ࠊ௧͕࣏ͬͯ൴ঁ΋Ͱ͖·ͨ͠ 100% φ ϯ τ!! ϑΥϩϫʔ ͔Βͷࢧ࣋཰
  6. /28 2020/12/12 #phpcon #࠙਌ձLT @ttskch 6 phpenv on Mac ೉͗͢͠ϫϩλ

  7. /28 phpenv install 7.4.13 [Success]: Built 7.4.13 successfully. 7 phpenvͱ͸

  8. /28 PKG_CONFIG_PATH="/usr/local/opt/krb5/lib/pkgconfig:/usr/local/ opt/openssl/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/ usr/local/opt/libedit/lib/pkgconfig:/usr/local/opt/libxml2/lib/ pkgconfig" \ PHP_BUILD_CONFIGURE_OPTS="--with-zlib-dir=/usr/local/opt/zlib -- with-bz2=/usr/local/opt/bzip2 --with-iconv=/usr/local/opt/

    libiconv --with-curl=/usr/local/opt/curl --with-libedit=/usr/ local/opt/libedit --with-jpeg-dir=/usr/local/opt/libjpeg --with- png-dir=/usr/local/opt/libpng" \ phpenv install 7.4.13 [Success]: Built 7.4.13 successfully. 8 ࠷ۙͷMacʹ͓͚Δݱ࣮ ࢀߟɿhttps://blog.ttskch.com/mac-phpenv-nodebrew/
  9. /28 9 Ͱ΋·͋࢖͑ͯΔ͓̺͠ʂ

  10. /28 10 ͦΜͳ͋Δ೔

  11. /28 11

  12. /28 12 Mac ಥવͷ͓๢͘ͳΓ

  13. /28 13 ͔ΒͷBig Sur࠶Πϯετʔϧ

  14. /28 PKG_CONFIG_PATH="/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/ openssl/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/ opt/libedit/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig" \ PHP_BUILD_CONFIGURE_OPTS="--with-zlib-dir=/usr/local/opt/zlib --with- bz2=/usr/local/opt/bzip2 --with-iconv=/usr/local/opt/libiconv --with-

    curl=/usr/local/opt/curl --with-libedit=/usr/local/opt/libedit -- with-jpeg-dir=/usr/local/opt/libjpeg --with-png-dir=/usr/local/opt/ libpng" \ phpenv install 7.0.33 ----------------- | BUILD ERROR | ----------------- 14 ݁Ռ
  15. /28 PKG_CONFIG_PATH="/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/ openssl/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/ opt/libedit/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig" \ PHP_BUILD_CONFIGURE_OPTS="--with-zlib-dir=/usr/local/opt/zlib --with- bz2=/usr/local/opt/bzip2 --with-iconv=/usr/local/opt/libiconv --with-

    curl=/usr/local/opt/curl --with-libedit=/usr/local/opt/libedit -- with-jpeg-dir=/usr/local/opt/libjpeg --with-png-dir=/usr/local/opt/ libpng" \ phpenv install 7.1.33 ----------------- | BUILD ERROR | ----------------- 15 ݁Ռ
  16. /28 PKG_CONFIG_PATH="/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/ openssl/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/ opt/libedit/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig" \ PHP_BUILD_CONFIGURE_OPTS="--with-zlib-dir=/usr/local/opt/zlib --with- bz2=/usr/local/opt/bzip2 --with-iconv=/usr/local/opt/libiconv --with-

    curl=/usr/local/opt/curl --with-libedit=/usr/local/opt/libedit -- with-jpeg-dir=/usr/local/opt/libjpeg --with-png-dir=/usr/local/opt/ libpng" \ phpenv install 7.2.34 ----------------- | BUILD ERROR | ----------------- 16 ݁Ռ
  17. /28 PKG_CONFIG_PATH="/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/ openssl/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/ opt/libedit/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig" \ PHP_BUILD_CONFIGURE_OPTS="--with-zlib-dir=/usr/local/opt/zlib --with- bz2=/usr/local/opt/bzip2 --with-iconv=/usr/local/opt/libiconv --with-

    curl=/usr/local/opt/curl --with-libedit=/usr/local/opt/libedit -- with-jpeg-dir=/usr/local/opt/libjpeg --with-png-dir=/usr/local/opt/ libpng" \ phpenv install 8.0.0 ----------------- | BUILD ERROR | ----------------- 17 ݁Ռ
  18. /28 18 7.0, 7.1, 7.2, 8.0 ͕Τϥʔ

  19. /28 PKG_CONFIG_PATH="/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/ openssl/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/ opt/libedit/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig" \ PHP_BUILD_CONFIGURE_OPTS="--with-zlib-dir=/usr/local/opt/zlib --with- bz2=/usr/local/opt/bzip2 --with-iconv=/usr/local/opt/libiconv --with-

    curl=/usr/local/opt/curl --with-libedit=/usr/local/opt/libedit -- with-jpeg-dir=/usr/local/opt/libjpeg --with-png-dir=/usr/local/opt/ libpng" \ phpenv install 7.3.25 [Success]: Built 7.3.25 successfully. 19 ݁Ռ
  20. /28 PKG_CONFIG_PATH="/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/ openssl/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/ opt/libedit/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig" \ PHP_BUILD_CONFIGURE_OPTS="--with-zlib-dir=/usr/local/opt/zlib --with- bz2=/usr/local/opt/bzip2 --with-iconv=/usr/local/opt/libiconv --with-

    curl=/usr/local/opt/curl --with-libedit=/usr/local/opt/libedit -- with-jpeg-dir=/usr/local/opt/libjpeg --with-png-dir=/usr/local/opt/ libpng" \ phpenv install 7.4.13 [Success]: Built 7.4.13 successfully. 20 ݁Ռ
  21. /28 21 7.3, 7.4 ͸ͳΜ͔ແࣄ

  22. /28 22 ௐ΂·ͨ͠

  23. /28 • Xcode 11.7ҎԼΛμ΢ϯϩʔυͯ͠ɺͦͷதͷSDKΛ࢖͏Α͏ʹ͢Δ 23 ·ͣ 7.1, 7.2 ࢀߟɿhttps://blog.ttskch.com/mac-catalina-big-sur-phpenv-php-build-error-under-php72/ •

    Xcode͕৽͗͢͠Δ ݪҼ ରॲ๏
  24. /28 • --without-tidy ͰϏϧυ͢Δ • ·ͨ͸ tidy-html5 ͷόʔδϣϯΛԼ͛Δ 24 7.0

    ͸͞Βʹ ࢀߟɿhttps://blog.ttskch.com/mac-phpenv-php-build-buf f i o-not-found-under-php70/ • HomebrewͰೖΕ͍ͯΔ tidy-html5 ͕৽͗͢͠Δ ݪҼ ରॲ๏
  25. /28 • ͢Έ·ͤΜɺΑ͘෼͔Γ·ͤΜ • --with-external-gd=/usr/local/opt/gd ͰϏϧυ͢Δ 
 ʢHomebrewͰೖΕͨgdΛ࢖͏Α͏ʹ໌ࣔʣ 25 8.0

    ͸ ࢀߟɿhttps://blog.ttskch.com/mac-phpenv-php-build-php80/ ݪҼ ରॲ๏
  26. /28 26 ݁࿦ɿ΍Ίͱ͚

  27. /28 27 ௐ΂ͨ͜ͱશ෦ϒϩάʹ·ͱΊ·ͯ͋Γ·͢ blog.ttskch.com/mac-phpenv-php-build ࠷ۙͷMacͰ5.6ʙ8.0·ͰΠϯετʔϧͰ͖ΔΑ͏ʹͳΓ·͢

  28. /28 28 @ttskch ʘThanks!ʗ