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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
gong023
January 14, 2016
Programming
13k
0
Share
Introduction of php-ext by rust
ごく簡単なphp拡張をrustで作る手順
gong023
January 14, 2016
Other Decks in Programming
See All in Programming
ローカルで稼働するAI エージェントを超えて / beyond-local-ai-agents
gawa
1
210
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
16
3.5k
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
280
2026-03-27 #terminalnight 変数展開とコマンド展開でターミナル作業をスマートにする方法
masasuzu
0
270
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
750
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
270
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
290
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
210
ネイティブアプリとWebフロントエンドのAPI通信ラッパーにおける共通化の勘所
suguruooki
0
230
Java 21/25 Virtual Threads 소개
debop
0
310
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
130
How to stabilize UI tests using XCTest
akkeylab
0
150
Featured
See All Featured
Balancing Empowerment & Direction
lara
5
1k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
160
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Discover your Explorer Soul
emna__ayadi
2
1.1k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.1k
For a Future-Friendly Web
brad_frost
183
10k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
260
How to Think Like a Performance Engineer
csswizardry
28
2.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.4k
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/