Monday, September 22, 2014

Fix HHVM 3.3 Bad Gateway error Debian Ubuntu

Found HHVM upgrade to 3.3 on Ubuntu Server 14.04 LTS:

Current status: 2 updates [+2], 33 new [+2].

The following packages will be upgraded:
hhvm linux-firmware
2 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 31.7 MB of archives. After unpacking 11.3 kB will be used.
Do you want to continue? [Y/n/?] y
Get: 1 http://ca.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-firmware all 1.127.6 [20.1 MB]
Get: 2 http://dl.hhvm.com/ubuntu/ trusty/main hhvm amd64 3.3.0~trusty [11.6 MB]
Fetched 31.7 MB in 9s (3,221 kB/s)
(Reading database ... 57804 files and directories currently installed.)
Preparing to unpack .../hhvm_3.3.0~trusty_amd64.deb ...
********************************************************************
* HHVM is being removed. You can remove it from your webserver with:
*
* $ sudo /usr/share/hhvm/uninstall_fastcgi.sh
* $ sudo /etc/init.d/nginx restart
* $ sudo /etc/init.d/apache restart
********************************************************************
Unpacking hhvm (3.3.0~trusty) over (3.2.0~trusty) ...
Preparing to unpack .../linux-firmware_1.127.6_all.deb ...
Unpacking linux-firmware (1.127.6) over (1.127.5) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up hhvm (3.3.0~trusty) ...
update-alternatives: using /usr/bin/hhvm to provide /usr/bin/php (php) in auto mode
********************************************************************
* HHVM is installed.
*
* Running PHP web scripts with HHVM is done by having your webserver talk to HHVM
* over FastCGI. Install nginx or Apache, and then:
* $ sudo /usr/share/hhvm/install_fastcgi.sh
* $ sudo /etc/init.d/hhvm restart
* (if using nginx) $ sudo /etc/init.d/nginx restart
* (if using apache) $ sudo /etc/init.d/apache restart
*
* Detailed FastCGI directions are online at:
* https://github.com/facebook/hhvm/wiki/FastCGI
*
* If you're using HHVM to run web scripts, you probably want it to start at boot:
* $ sudo update-rc.d hhvm defaults
*
* Running command-line scripts with HHVM requires no special setup:
* $ hhvm whatever.php
*
* You can use HHVM for /usr/bin/php even if you have php-cli installed:
* $ sudo /usr/bin/update-alternatives --install /usr/bin/php php /usr/bin/hhvm 60
********************************************************************


The web server shows: Bad Gateway.

Try restart HHVM:

# service hhvm restart
* Restarting HHVM FastCGI Daemon hhvm
/usr/bin/hhvm: error while loading shared libraries: libgmp.so.10: cannot open shared object file: No such file or directory


Install libgmp10 package, restart HHVM solve the problem:

# aptitude install libgmp10
The following NEW packages will be installed:
libgmp10
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.

# service hhvm restart
* Restarting HHVM FastCGI Daemon hhvm

1 comment:

  1. Thanks a lot, that solved the problem.

    ReplyDelete