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/

Takashi Kanemoto

December 12, 2020
Tweet

More Decks by Takashi Kanemoto

Other Decks in Programming

Transcript

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

    View full-size slide

  2. /28
    2
    • ʙ2020/03

    (ג)ΧϧςοτίϛϡχέʔγϣϯζCTO

    blog.ttskch.com/thank-you-quartet-communications


    • 2020/04ʙ

    ϑϦʔϥϯεWebΤϯδχΞ

    https://kannade.jp
    ͖ͨͭͪʢ໊͋ͩʣ

    View full-size slide

  3. /28
    3
    ͖ͨͭͪʢ໊͋ͩʣ
    • ϦεςΟϯά޿ࠂͷձࣾͰWebαʔϏεΛ࡞ͬͯ·ͨ͠


    • CTOͱͯ͠ࡏ੶ͨ͠8೥ؒͰɺࣾһ਺2໊ˠ60໊ɺ

    ച্ن໛5000ສԁˠ27ԯԁʹ·Ͱ੒௕

    View full-size slide

  4. /28
    4
    • ͓ख఻͍ͨ͠ຊʢ2015/12ʣ


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

    View full-size slide

  5. /28
    5
    twitter.com/ ttskch
    ͋͞ɺ͋ͳͨ΋ࠓ͙͢ϑΥϩʔ͠Α͏ʂ
    100%
    ͍ͯ͠Δ
    ͍ͯ͠ͳ͍
    ϑΥϩϫʔ͞Μ100ਓʹฉ͖·ͨ͠
    ͖ͨͭͪΛϑΥϩʔ͍ͯ͠Δʁ
    ͨ ͭ ͖ ͪ
    ׬શແྉʂ
    ·͞ʹ໊ݴ੡଄ػ
    ਓੜͰେ੾ͳ͜ͱ͸

    ͢΂͖͔ͯͨͭͪΒڭΘͬͨ
    ͖ͨͭͪΛϑΥϩʔͨ͠Β

    ࠊ௧͕࣏ͬͯ൴ঁ΋Ͱ͖·ͨ͠
    100%
    φ
    ϯ
    τ!!
    ϑΥϩϫʔ


    ͔Βͷࢧ࣋཰

    View full-size slide

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

    View full-size slide

  7. /28
    phpenv install 7.4.13


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

    View full-size slide

  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/

    View full-size slide

  9. /28
    9
    Ͱ΋·͋࢖͑ͯΔ͓̺͠ʂ

    View full-size slide

  10. /28
    10
    ͦΜͳ͋Δ೔

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  13. /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
    ݁Ռ

    View full-size slide

  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.1.33


    -----------------


    | BUILD ERROR |


    -----------------
    15
    ݁Ռ

    View full-size slide

  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.2.34


    -----------------


    | BUILD ERROR |


    -----------------
    16
    ݁Ռ

    View full-size slide

  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 8.0.0


    -----------------


    | BUILD ERROR |


    -----------------
    17
    ݁Ռ

    View full-size slide

  17. /28
    18
    7.0, 7.1, 7.2, 8.0 ͕Τϥʔ

    View full-size slide

  18. /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
    ݁Ռ

    View full-size slide

  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.4.13


    [Success]: Built 7.4.13 successfully.


    20
    ݁Ռ

    View full-size slide

  20. /28
    21
    7.3, 7.4 ͸ͳΜ͔ແࣄ

    View full-size slide

  21. /28
    22
    ௐ΂·ͨ͠

    View full-size slide

  22. /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͕৽͗͢͠Δ
    ݪҼ
    ରॲ๏

    View full-size slide

  23. /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 ͕৽͗͢͠Δ
    ݪҼ
    ରॲ๏

    View full-size slide

  24. /28
    • ͢Έ·ͤΜɺΑ͘෼͔Γ·ͤΜ
    • --with-external-gd=/usr/local/opt/gd ͰϏϧυ͢Δ

    ʢHomebrewͰೖΕͨgdΛ࢖͏Α͏ʹ໌ࣔʣ
    25
    8.0 ͸
    ࢀߟɿhttps://blog.ttskch.com/mac-phpenv-php-build-php80/
    ݪҼ
    ରॲ๏

    View full-size slide

  25. /28
    26
    ݁࿦ɿ΍Ίͱ͚

    View full-size slide

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

    View full-size slide

  27. /28
    28
    @ttskch
    ʘThanks!ʗ

    View full-size slide