Hip Hop for PHP An Introduction HPHP Migration

  • Slides: 26
Download presentation
Hip. Hop for PHP An Introduction

Hip. Hop for PHP An Introduction

HPHP

HPHP

Migration Attempts • Python (FAIL) • C++ (FAIL) • Java (FAIL) • Python (Again)

Migration Attempts • Python (FAIL) • C++ (FAIL) • Java (FAIL) • Python (Again) (FAIL)

Credit: http: //terrychay. com/article/hiphop-for-faster-php. shtml/4

Credit: http: //terrychay. com/article/hiphop-for-faster-php. shtml/4

Credit: http: //terrychay. com/article/hiphop-for-faster-php. shtml/4

Credit: http: //terrychay. com/article/hiphop-for-faster-php. shtml/4

http: //wiki. github. com/facebook/hiphop-php/

http: //wiki. github. com/facebook/hiphop-php/

Similar Projects • APC/XCache/e. Accelerator • Roadsend • Quercus • Raven • Project Zero

Similar Projects • APC/XCache/e. Accelerator • Roadsend • Quercus • Raven • Project Zero • Phalanger • PHC

Issues?

Issues?

What Isn’t Supported?

What Isn’t Supported?

“If eval() is the answer, you’re almost certainly asking the wrong question. ” -

“If eval() is the answer, you’re almost certainly asking the wrong question. ” - Rasmus

Other methods of dynamic code generation (writing PHP code on the fly, Smarty, etc.

Other methods of dynamic code generation (writing PHP code on the fly, Smarty, etc. )

$varname = “yellow”; $yellow = “Hello, World!n”; echo $$varname;

$varname = “yellow”; $yellow = “Hello, World!n”; echo $$varname;

Others. . . create_function() preg_replace(‘/. */e’) *_exists($something) + conditional

Others. . . create_function() preg_replace(‘/. */e’) *_exists($something) + conditional

So, who benefits from HPHP?

So, who benefits from HPHP?

 • Applications using > 2 servers to serve dynamic content • PHP applications

• Applications using > 2 servers to serve dynamic content • PHP applications that need source obfuscated • Use for code analysis to improve performance, even w/o HPHP deployment

Who does not benefit from HPHP?

Who does not benefit from HPHP?

 • Sites w/ minimal traffic • Shared hosting • “PHP is rarely the

• Sites w/ minimal traffic • Shared hosting • “PHP is rarely the bottleneck” - Rasmus • Most OSS project developers • Apps using PHP 5. 3 • Apps on 32 -bit systems • Windows users

Getting HPHP running is NOT easy!

Getting HPHP running is NOT easy!

Some suggestions if you want to use HPHP. . .

Some suggestions if you want to use HPHP. . .

 • Plan for crashes! • Use nginx in front of HPHP • Refresh

• Plan for crashes! • Use nginx in front of HPHP • Refresh your C++ knowledge • Be willing to help port extensions • Create your own build scripts • Use distcc if you can • Pay attention to known issues!

And now. . . the demo!

And now. . . the demo!