easyengine icon indicating copy to clipboard operation
easyengine copied to clipboard

HipHop Support

Open duajanuari opened this issue 12 years ago • 52 comments

Hi,

It seems HipHop support is nice, they have prebuilt packages, and perform quite better than php5-fpm. Not much changing codes I guess.

Here, take a look at this: https://github.com/facebook/hhvm/wiki#installing-pre-built-packages-for-hhvm

duajanuari avatar Apr 12 '14 05:04 duajanuari

Yep. HipHop is on list. We will be putting it on rtcamp.com server later this month. If it works there, we will test it on few more servers on different website.

If all goes well, we will be happy to add it to EasyEngine in future. :-)

rahul286 avatar Apr 12 '14 08:04 rahul286

Related: https://twitter.com/MiteshShah05/status/456444758529814528

rahul286 avatar Apr 17 '14 13:04 rahul286

hello, that @hmd on twitter is me, how i install hhvm is quite simple, just install hhvm from prebuilt packages and stop php5-fpm service.

if you wanna take a look my droplet at digital ocean which hhvm installed, i'd happy to add your public key :)

duajanuari avatar Apr 22 '14 07:04 duajanuari

How does droplet sharing work? Can I clone yours somehow? I'm just busy with one of my own test-droplets, gave up on hhvm because I installed Debian 32bit and apparently they only have packages for 64bit so far...

ovizii avatar Apr 22 '14 07:04 ovizii

@ovizii thanks for info on 32-bit

easyenigne supports 32-bit as well so if we need to support hhvm then we will either have to maintain 2 different install scripts internally or force everyone to use 64-bit. Both are not good.

We are installing hhvm today on few servers manually. We will takes notes of our experience. If all goes well, we can make it default in easyengine.

rahul286 avatar Apr 22 '14 07:04 rahul286

I have functional EE install @MiteshShah setup on Unbuntu 14.04 if you'd like me to clone it for you? Just me know and I will spin it up now...@miteshshah pub-key is already installed to it

shaneholloman avatar Apr 22 '14 07:04 shaneholloman

I didn't find this info anywhere but I got a dependency problem with apt-get on Debian 7 32bit so I checked the repos:

http://dl.hhvm.com/debian/dists/wheezy/main/binary-i386/Packages vs http://dl.hhvm.com/debian/dists/wheezy/main/binary-amd64/Packages

ovizii avatar Apr 22 '14 08:04 ovizii

@shaneholloman Thanks for offer but setup is not a problem.

By believe anything goes into easyengine should be tested on rtcamp.com first. Its less painful to break own sites rather than others. ;-)

Just some time back, I came to know about hhvm doesn't support 32-bit. There is also some thready suggesting hhvm doesn't play nicely with non-mysql databases.

On wordpress sites, there are so many themes and plugins and I just want to make sure hhvm doesn't create any issue for atleast some top themes and plugins.

So here is the flow (for hhvm and every stuff like this gets added into easyengine):

  1. Install and test on our test/staging server
  2. Install and test on our on production server (which runs rtcamp.com)
  3. Install and test on our clients test/staging server
  4. Install and test on our clients production server

Each step usually takes a week. Sometimes more.

It may sound bit conservative approach but even after this, we see people running into issues.

In meanwhile, if you come across any issue or special notes related to hhvm, please share.

We need to ensure 32-bit and 64-bit support for atleast Ubuntu 12.04/14.04 and Debian 6/7.

rahul286 avatar Apr 22 '14 08:04 rahul286

@ovizii https://github.com/facebook/hhvm/wiki#installing-pre-built-packages-for-hhvm has better info.

I see 32-bit and Debian 6 are not supported.

I personally don't use 32-bit anywhere. Not on servers with lower RAM.

Does anybody here use 32-bit?

rahul286 avatar Apr 22 '14 08:04 rahul286

I use 64bit only

shaneholloman avatar Apr 22 '14 08:04 shaneholloman

Sorry for accidentally closing this. Reopend now.

rahul286 avatar Apr 22 '14 08:04 rahul286

hm, I tried 32bit on a low-end droplet, will give 64bit a try too :-)

ovizii avatar Apr 22 '14 18:04 ovizii

Any updates on this? It would be cool if EE did this out of the box. But if it does not, that's ok too. I followed the following two tutorials and got HHVM working perfectly with my wordpress install. Works like a charm! https://kinsta.com/blog/hhvm-and-wordpress/ and http://fideloper.com/hhvm-nginx-laravel

adrianocr avatar Jul 22 '14 00:07 adrianocr

@adrianocr Currently we are testing HHVM on our servers. If all goes well then soon EE will land up with HHVM.

gau1991 avatar Jul 22 '14 05:07 gau1991

Cool I'd love to hear your experiences with HHVM so far.

coreyallen avatar Jul 22 '14 05:07 coreyallen

@gau1991 @rahul286 running EE 1.3.8 I was able to do what I stated above (https://github.com/rtCamp/easyengine/issues/180#issuecomment-49685080). But now in version 2.0.1 I can't figure out how to do this. I have a wt3c wordpress site that was created by EE. I went to /sites-available/domainname.conf and added

location ~ \.(hh|php)$ {
fastcgi_keep_conn on;
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
include        fastcgi_params;
}

but it didn't work. I tried including the hhvm.conf file in the domainname.conf file, I tried replacing the php.conf file inside /etc/nginx with the hhvm.conf file (renaming it to php.conf, of course), I tried adding the location block inside w3tc.conf, etc. Nothing seems to get wordpress to load using HHVM. I have a test file at domainame.com/hhvmtest.php with the following inside

<?php
echo  defined('HHVM_VERSION')?'Using HHVM':'Not using HHVM';

It states "Not using HHVM". If from the command line I run hhvm hhvmtest.php it works perfectly and states "Using HHVM". So can you guys point me to the right files/directory for me to set this up? Should I post this on the forum? Thanks!

adrianocr avatar Jul 23 '14 19:07 adrianocr

@adrianocr , We have written a small tutorial for HHVM with EE 2.x, https://github.com/rtCamp/easyengine/wiki/HHVM-with-EE-2.x.x Please go through this

gau1991 avatar Jul 24 '14 07:07 gau1991

Hey, guys, sorry for the delay! I was a bit busy for a few days. The above guide worked perfectly! WordPress is purring like a well oiled kitten (I might have gotten my metaphors mixed up there). I wanted to know if there is anyway to bypass hhvm and use php5-fpm? So basically have PHP fall back to the backup. Reason I ask is because some apps aren't hhvm ready (like Drupal and CraftCMS) and I would like to run them side-by-side in the same server. Maybe a PHP location block inside the specific domain.conf?

adrianocr avatar Jul 30 '14 17:07 adrianocr

@adrianocr , I am assuming you have created either PHP or MySQL site with EE You need to do following settings: Fist copy php.conf to php-new.conf

cp -v /etc/nginx/common/php.conf /etc/nginx/common/php-new.conf

Then open php-new.conf

vim /etc/nginx/common/php-new.conf

and change from

        fastcgi_pass php;

to

        fastcgi_pass 127.0.0.1:9000;

Now edit your site

ee site edit example.com

and change

        include common/php.conf;

to

        include common/php-new.conf;

Done, now your PHP/MySQL site example.com will use FPM instead of HHVM

gau1991 avatar Jul 31 '14 10:07 gau1991

@gau1991 please share upstream and HHVM/FPM failover style config we are using on our servers. It may benefit others and we might get some feedback from early hhvm adaptors. :-)

rahul286 avatar Jul 31 '14 10:07 rahul286