Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
phpenvやめました🤦♂️
Search
Takashi Kanemoto
July 28, 2021
Programming
0
1.3k
phpenvやめました🤦♂️
「PHPerの今とその先を語り合うフォーラム2021」PHP TechCafeのLT資料です。
https://rakus.connpass.com/event/217189/
Takashi Kanemoto
July 28, 2021
Tweet
Share
More Decks by Takashi Kanemoto
See All by Takashi Kanemoto
今年書いた技術記事で伸びたやつの自慢と自分の中では力作なのにさっぱり伸びなかったやつの供養 / My Tech Articles 2024
ttskch
0
26
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
47
29k
データベース/SQL超入門!完全初心者向けに世界一分かりやすく解説します
ttskch
1
4.5k
Symfony UX Autocompleteとかいう 顧客が本当に必要だったもの
ttskch
0
1.8k
就活生あるいは新人エンジニアさんへのお節介なアドバイス
ttskch
0
1.5k
symfony/pantherでWordleを解いてみた
ttskch
0
270
ついに、Webアプリでの帳票印刷のベストプラクティスを編み出しました💡
ttskch
16
19k
PHPでCSVのインポート/エクスポートに立ち向かう
ttskch
1
2.2k
phpenv on Mac 難しすぎワロタ
ttskch
0
560
Other Decks in Programming
See All in Programming
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
170
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
1
300
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
140
Amazon Qを使ってIaCを触ろう!
maruto
0
410
Micro Frontends Unmasked Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
110
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.5k
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
250
Jakarta EE meets AI
ivargrimstad
0
130
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
Jakarta EE meets AI
ivargrimstad
0
670
Featured
See All Featured
A designer walks into a library…
pauljervisheath
204
24k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
The Cult of Friendly URLs
andyhume
78
6k
How to Ace a Technical Interview
jacobian
276
23k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Transcript
/16 2021/07/28 #PHPTechCafe @ttskch 1 phpenvΊ·ͨ͠🤦
/16 • ϦεςΟϯάࠂͷձࣾͰWebαʔϏεΛ࡞ͬͯ·ͨ͠ • CTOͱͯ͠ࡏ੶ͨ͠8ؒͰɺࣾһ2໊ˠ60໊ɺ ച্ن5000ສԁˠ27ԯԁʹ·Ͱ 💪 💪 💪
• ຊΛॻ͍ͨΓSchooͰߨٛͨ͠Γͱ͍ͬͨ׆ಈ 2 ͖ͨͭͪ ʙ2020/03 (ג)ΧϧςοτίϛϡχέʔγϣϯζCTO 📝 blog.ttskch.com/thank-you-quartet-communications @ttskch
/16 • डୗ։ൃͱࣾ֎CTO/ٕज़ސۀத৺Ͱ׆ಈͯ͠·͢ • Symfony͕େ͖Ͱ͢ ✨ • ڈΞυϕϯτΧϨϯμʔΛ1ਓͰ15ॻ͍ͨΓ 10ສจࣈͷిࢠॻ੶Λແྉެ։ͨ͠Γ͠·ͨ͠💪💪💪
3 ͖ͨͭͪ 2020/04ʙ ϑϦʔϥϯεWebΤϯδχΞ 👨💻 kannade.jp @ttskch
/16 2021/07/28 #PHPTechCafe @ttskch 4 phpenvΊ·ͨ͠🤦
/28 $ phpenv install 8.0.0 [Success]: Built 8.0.0 successfully. 5
phpenvͱ
/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 --with-external-gd=/usr/local/opt/gd" \ phpenv install 8.0.0 [Success]: Built 8.0.0 successfully. 6 ࠷ۙͷMacʹ͓͚Δݱ࣮ ࢀߟɿhttps://blog.ttskch.com/mac-phpenv-php-build/
/16 7 ৄͪ͘͜͠Β https://speakerdeck.com/ttskch/phpenv-on-mac-nan-sisugiwarota
/xxx 8 ͰɺͳΜ͔Μ͋ͬͯ
/16 9 ݁ہphpenvΊ·ͨ͠ https://twitter.com/ttskch/status/1406141047063801856
/16 • PHPͷϏϧυ৭ΜͳϛυϧΣΞʹґଘ͍ͯͯ͠ɺԿͯ͠ͳ͍ͷʹյΕΔ ͜ͱ͕Α͋͘Δ্ʹτϥϒϧγϡʔτ͕େม͗͢Δ • ϏϧυΤϥʔΛղফ͠Α͏ͱඞਢͰάάͬͯͨΒ࠷ऴతʹ Homebrew/homebrew-coreͷIssueͰ͢ͰʹٞࡁΈͩͬͨͷΛݟ͚ͭͯɺ ࣗҰମԿΛ࠶ൃ໌͍ͯ͠ΔΜͩΖ͏͔ͱ͍͏ؾ࣋ͪʹͳΔ
• Homebrewʹର͢ΔԼهͷΞυόϯςʔδଞͷखஈͰेସͰ͖Δʢޙड़ʣ 1. ύονόʔδϣϯ୯ҐͰόʔδϣϯࢦఆͰ͖Δ 2. .php-version ͰσΟϨΫτϦ͝ͱʹPHPͷόʔδϣϯΛࢦఆͰ͖Δ 10 Ίͨཧ༝
/16 • ࣮ࡍͷͱ͜Ζɺύονόʔδϣϯ·Ͱࢦఆ͍ͨ͠έʔεͳΜͯ΄΅ͳ͍🤦 • ͋ͬͨ͠Βͦͷ͚࣌ͩDocker͍͍͔͑ͳ 11 1. ύονόʔδϣϯ୯ҐͰόʔδϣϯࢦఆͰ͖Δʁ
/16 12 2. σΟϨΫτϦ͝ͱʹPHPͷόʔδϣϯΛࢦఆͰ͖Δʁ • direnvͱ͍͏πʔϧͰ΄΅ಉ͜͡ͱͰ͖Δ👌 • .envrc ͱ͍͏ϑΝΠϧʹڥมΛఆ͓ٛͯ͘͠ͱɺͦͷσΟϨΫτϦʹ Ҡಈͨ͠ͱ͖ʹࣗಈͰڥมΛಡΈࠐΜͰ͘ΕΔπʔϧ
• https://github.com/direnv/direnv
/28 # Πϯετʔϧ $ brew install direnvʊ $ echo 'eval
"$(direnv hook zsh)"' >> ~/.zshrcʊ # σΟϨΫτϦ͝ͱʹPHPͷύεΛࢦఆ $ cd /path/to/projectʊ $ echo 'export PATH="/usr/local/opt/
[email protected]
/bin:$PATH"' > .envrcʊ $ direnv allow . 13 direnv
/16 14 ͪͳΈʹextension • PECLͰΠϯετʔϧͯ͠ php.ini ʹهɺͰ؆୯ʹՃͰ͖Δ # PECLͷ࣮ߦʹඞཁͳϛυϧΣΞΛΠϯετʔϧ $
brew install pkg-config zlibʊ # Πϯετʔϧͯ͠php.iniʹه $ pecl install apcuʊ $ echo 'extension=apcu.so' >> /usr/local/etc/php/7.4/php.ini ࢀߟɿhttps://grrr.tech/posts/installing-homebrew-php-extensions-with-pecl/
/16 • phpenv on Mac͗͢͠Δ • Homebrewʹର͢ΔΞυόϯςʔδผͷπʔϧͳͲͰସՄೳ • ͜Ε͔ΒϏϧυͷͭΒΈΛΘΓʹͬͯ͘Ε͍ͯΔ͜ͱʹײँͭͭ͠ HomebrewͷPHPΛ͍͖ͬͯ·͢😇
15 ·ͱΊ
/16 16 @ttskch ʘThanks!ʗ