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
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
150
AI Agents: How Do They Work and How to Build Them @ Shift 2025
slobodan
0
100
さようなら Date。 ようこそTemporal! 3年間先行利用して得られた知見の共有
8beeeaaat
3
1.5k
ぬるぬる動かせ! Riveでアニメーション実装🐾
kno3a87
1
230
アセットのコンパイルについて
ojun9
0
130
為你自己學 Python - 冷知識篇
eddie
1
350
Ruby×iOSアプリ開発 ~共に歩んだエコシステムの物語~
temoki
0
350
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
デザイナーが Androidエンジニアに 挑戦してみた
874wokiite
0
550
Performance for Conversion! 分散トレーシングでボトルネックを 特定せよ
inetand
0
3.4k
はじめてのMaterial3 Expressive
ym223
2
900
AIを活用し、今後に備えるための技術知識 / Basic Knowledge to Utilize AI
kishida
22
5.9k
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
KATA
mclloyd
32
14k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Music & Morning Musume
bryan
46
6.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
530
Bash Introduction
62gerente
615
210k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
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/