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
Introduction of php-ext by rust
Search
gong023
January 14, 2016
Programming
0
13k
Introduction of php-ext by rust
ごく簡単なphp拡張をrustで作る手順
gong023
January 14, 2016
Tweet
Share
Other Decks in Programming
See All in Programming
UbieのAIパートナーを支えるコンテキストエンジニアリング実践
syucream
2
680
ワープロって実は計算機で
pepepper
2
1.4k
兎に角、コードレビュー
mitohato14
0
150
技術的負債で信頼性が限界だったWordPress運用をShifterで完全復活させた話
rvirus0817
1
2k
オープンセミナー2025@広島LT技術ブログを続けるには
satoshi256kbyte
0
120
エンジニアのための”最低限いい感じ”デザイン入門
shunshobon
0
130
GitHub Copilotの全体像と活用のヒント AI駆動開発の最初の一歩
74th
8
3.1k
一人でAIプロダクトを作るための工夫 〜技術選定・開発プロセス編〜 / I want AI to work harder
rkaga
12
2.8k
State of CSS 2025
benjaminkott
1
120
パスタの技術
yusukebe
1
400
「リーダーは意思決定する人」って本当?~ 学びを現場で活かす、リーダー4ヶ月目の試行錯誤 ~
marina1017
0
240
20250808_AIAgent勉強会_ClaudeCodeデータ分析の実運用〜競馬を題材に回収率100%の先を目指すメソッドとは〜
kkakeru
0
200
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
Optimizing for Happiness
mojombo
379
70k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.5k
Typedesign – Prime Four
hannesfritz
42
2.8k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
4 Signs Your Business is Dying
shpigford
184
22k
Balancing Empowerment & Direction
lara
2
580
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
Transcript
Introduction of php-ext by rust
About me • gong023 • https://github.com/gong023/ • PHP developer of
• #mercari_wakate??
I — PHP
Interested in rust
rust is • supported by Mozilla • to replace Firefox
engine • better C++ • golang is better C
rust is good because…
Safe memory You can compile errors with dangerous memory operations
Safe memory You can compile errors with dangerous memory operations
Modern syntax • Optional
Modern syntax • Generics & Traits
create php-ext by rust
Overview 1. Create shared object file by rust 2. Test
shared object file by C 3. Link shared object file from php-ext
Create .so file by rust 1. cargo new 2. write
a function in rust 3. cargo build • you can get *.so file
Test .so file by C 1. Write test code in
C 2. Include .so and compile C test code • Don’t forget to link shared object • gcc test.c -L SO_PATH -php_ext
Link .so file from php-ext 1. Create php-ext by ext-skel
2. Edit config.m4 and configure • difficult…
Link .so file from php-ext • Edit config.m4 I don’t
know why it doesn’t work
Link .so file from php-ext • Edit config.m4 I added
a path ignoring errors
Link .so file from php-ext 3. Write .h and .c
in php-ext • see references to know more details 4. make && make install 5. Test
Advanced • I tried to export rust-carbon to php-ext •
https://github.com/gong023/rust-carbon • But I don’t succeed yet. I don’t know why it doesn’t work
References • http://hermanradtke.com/2015/08/03/ creating-a-php-extension-to-rust.html • https://github.com/hjr3/rust-php-ext • http://postd.cc/creating-a-php-extension-in- rust/