finds.dev

tenderlove/phuby

phuby wraps PHP in a loving embrace

View on GitHub

★ 268Rubyupdated May 2016

// the take

Phuby embeds a PHP runtime inside a Ruby process via a C extension, letting you eval PHP code and exchange variables between the two runtimes. It's a joke project by Aaron Patterson (tenderlove) that actually works, or at least worked circa 2016. There is no real use case for this in production.

The C extension does genuine work — it links against PHP's embed SAPI and handles type conversions between PHP and Ruby values including arrays. Aaron Patterson wrote it, so the C is competent. It includes a Rack handler (`phuby/rails.rb`, `php_handler.rb`) meaning you could theoretically serve PHP files through a Rails app. The README's install instructions section just says 'No.' which is honest.

Dead since 2016 and requires building PHP from source with `--enable-embed`, which almost no distro ships. The extconf.rb hardcodes a mysql path and the README openly admits this won't be fixed. PHP's embed SAPI is not thread-safe, so this will explode under any concurrent Ruby server. The whole thing was built on OS X against whatever PHP version existed in 2013 — getting it to compile today would be an archaeology project.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
268
Forks
14
Language
Ruby
Last commit
2 May 2016

// nearby

If phuby isn't quite it.

All repos →