1

Can any one here provide me a good tutorial on compiling PHP using HipHop? i saw this link . But i cannot understand the linux commands. I developed the application in windows. I was not able to run those commands in linux
$HPHP_HOME/src/hphp/hphp test.php
This command gave me error bash command not found.
in the source i got, i do not have anything named hphp inside the folder hphp, is that a method inside main.cpp???

Akbar Ali
  • 295
  • 1
  • 6
  • 13
  • 2
    I believe that learning the basics of Linux is worthwhile in your case. Did you consider installing Linux on your laptop and take some time to learn it (thru the command line mostly)? – Basile Starynkevitch Dec 31 '12 at 08:03

1 Answers1

9

Can any one here provide me a good tutorial on compiling PHP using HipHop? [...] i cannot understand the linux commands.

HipHop and the companion/successor HHVM, are for advanced users that are trying to resolve specific performance edge cases. Normal PHP developers will not ever benefit from any of the things that HipHop provides. In fact, in many cases, you can get just as much of a performance benefit through simple performance profiling and targeted optimizations combined with a bytecode cache, like APC.

If you do not understand the commands needed to get it running, you do not fall into the class of user that should attempt to use it. Break out your profiling tools instead, as they will be far, far more valuable to you.


It's been clarified that the actual intent is to use HipHop as a PHP code protection mechanism. That's an even worse idea!

  • HipHop is designed to run as an application server. That is, it contains a web server.
  • HipHop binaries are huge, often greater than 500 MB. They are not appropriate for redistribution.
  • HipHop memory use is significantly larger than the binary.
  • HipHop is designed and intended to run on machines dedicated to the task.

It's not intended for that purpose... and everything can be decompiled. That includes the commercial products that are designed for the task, ionCube and Zend Guard. All it takes is a bit of time or money, and your source is mine. Your best defense against intellectual property theft is a good license and a good lawyer, not a technological solution that makes it harder to run your code.

Charles
  • 50,943
  • 13
  • 104
  • 142
  • I am not interested in performance optimization by HipHop, I need to compile the php code. I am more concerned about the security of my code. I need to convert it to byte code so that no one will see or modify what i did – Akbar Ali Dec 31 '12 at 08:23
  • @AkbarAli There are PHP-level obfuscation methods that work well, like [ionCube](http://www.ioncube.com/). Having personally seen the output of one, I can attest to their effectiveness. I recommend you use an obfuscator to keep the advantages of cross-platform compatibility and PHP integration in server environments. In any case, why do you care that no one sees what you did, and how would they do so? PHP is server-side, after all. – Waleed Khan Dec 31 '12 at 08:29
  • 2
    You do understand that HipHop binaries are in the 500-ish meg range at the *minimum*, require *gigs* of memory to run, and are designed run on dedicated servers, right? It is not designed or intended as an intellectual property protection mechanism. Nor is PHP. Every single "protection" mechanism is *trivial* to crack given time and/or money, including ionCube and Zend Guard. Your best defense is a good license and a good lawyer. – Charles Dec 31 '12 at 08:30
  • @Charles "Your best defense against intellectual property theft is a good license and a good lawyer, not a technological solution that makes it harder to run your code." --- +1 on that :) – LoneWOLFs Dec 31 '12 at 10:09
  • Ok Guys, agreed, I am not going to use HipHop for compiling my code, instead i will use something like `ioncCube`. But, I guess, there is no harm in learning how to compile PHP code using HipHop. @Charles: How about good license, good lawyer and good obfuscation. BTW thanks for the info on HipHop – Akbar Ali Jan 02 '13 at 05:17
  • @Charles HHVM is getting better and better each day. It carries many best features that classic PHP does not have. I think you need to update your answer. – fSazy Apr 30 '14 at 14:35