Step 1: Manually Building the Repo.
Two type method of building the Repo. :-
Sub Step 1: Everything Under a Root
To build a repo including all files recursively under /path/to/root, invoke HHVM like this:
$ sudo hhvm --hphp -t hhbc -v AllVolatile=true --input-dir /var/www/html
Sub Step 2: Manual List of Files
Instead of a directory, you can also pass it an explicit list of filenames to put in the repo or a master file that contains all of the files, one per line, that should be put in the repo. (Keep in mind that the commands below are generating two separate repos -- you can't add to or remove from a repo once it's been generated!)
$ sudo hhvm --hphp -t hhbc -v AllVolatile=true test.php
OR
$ sudo hhvm --hphp -t hhbc -v AllVolatile=true --input-list test.txt
Example : The test.txt should look like this :
/var/www/html/isrc/a.php
/var/www/html/isrc/b.php
/var/www/html/ilib/c.php
Step 2: Both Process Response
Output look like this :
analyzeProgram...
analyzeProgram took 0'00" (837359 us) wall time
parsing inputs took 0'12" (12853383 us) wall time
pre-optimizing...
pre-optimizing took 0'01" (1232182 us) wall time
creating binary HHBC files...
creating binary HHBC files took 0'52" (52337765 us) wall time
all files saved in /tmp/hphp_tGw0TO ...
running hphp took 1'07" (67944928 us) wall time
Note : bytecode repo /path/to/ = /tmp/hphp_tGw0TO
Step 3 : Permission to ByteCode folder
$ sudo chmod -R 777 /tmp/hphp_tGw0TO
Step 4: Manually Deploying the Repo
You can put the repo file anywhere as long as these two ini settings are set correctly in your server.ini (or equivalent) file
$ sudo hhvm.repo.central.path=/tmp/hphp_tGw0TO/hhvm.hhbc
Step 5: HHVM SERVER RESTART AND CHECK STATUS
$ sudo service hhvm restart
$ sudo service hhvm status
OUTPUT :
* hhvm is running
Nice article very useful
ReplyDeleteThank !
Delete