HHVM crash with version 3.18.0

If you installed the last version of HHVM (version 3.18.0) and restart your server or HHVM then you get the following error within /var/log/nginx/error.log:

connect() to unix:/var/run/hhvm/hhvm.sock failed (111: Connection refused) while connecting to upstream …

and within /var/log/hhvm/error.log:

Failed to initialize central HHBC repository:\n Failed to initialize schema in /var/run/hhvm/hhvm.hhbc(rw-r–r– root:root): \n Failed to open /var/www/.hhvm.hhbc: 14 – unable to open database file\n

The problem is with the new version hhvm creates the hhvm.hhbc with the user root and the user www-data can’t access the file. A workaround is to specify the user within the /etc/hhvm/server.ini:

hhvm.repo.central.file_user=www-data
hhvm.repo.central.file_group=www-data
hhvm.repo.central.file_mode=493

then restart hhvm with:

/etc/init.d/hhvm restart

That’s all 🙂

Source: https://milliondollarserver.com/hhvm-3-18-0-crash-on-ubuntu-16-04-with-nginx.html

Install ssh2 in php 5.5.3

I needed SSH2 authentification in php for the wordpress autoupdate function on my new server with ubuntu 13.10. Well it sounds easy just to install ssh2 and everything works fine but it costs me some time …

First I installed ssh2 extentions with this command

apt-get install libssh2-php

Restarted apache, even rebooted the server but php -m | grep ssh2 gives me no output. The ssh2 php extentions just dont work.

After some try and error I found a solution. I had to move the /etc/php/conf.d/ssh2.ini to the directory /ect/php/mods-available with this command

mv /etc/php/conf.d/ssh2.ini /ect/php/mods-available

After this I had to enable the extention within php with this command

php5enmod ssh2

Restart apache with

service apache2 restart

And test again with php -m | grep ss2 It should work now 🙂