Tech geek. Life geek.


HHVM 3.6 has problem with MariaDB

The same script php file, always works smoothly on HHVM 3.2 to HHVM 3.5. Until I upgrade it to HHVM 3.6.

It is a simply script which use mysqli connection and so on. Now it is shown the error as below:

Connect failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I tried to find the answer and faild. So I upgrde the HHVM to nightly build version. It is 3.7-dev.

davidyin@fiob:/etc/hhvm$ hhvm --version
HipHop VM 3.7.0-dev (rel)
Compiler: heads/master-0-g0359d4a4bbb22c5defd7eb024194aed0af24c80b
Repo schema: 9008d5e6e7f6584d09ed3b14deceac5a34f363c1

And it did solve the error, and the script is working as expected.

But, later I found the reason why it happen.


hhvm.mysql.socket = /tmp/mysql.sock

into server.ini

To specify the mysql socket and let HHVM knows how to connect mySQL server or MariaDB server.

I did not try the solution.  I found it here.

PHP Benchmark on HHVM, Nginx Web Server

The test is almost same as I did before on php 5.5, php5.4 and php5.3, or php-fpm. It is running on the HHVM and Nginx.

The installation of Ubuntu 14.04, Nginx, MariaDB, HHVM is posted yesterday.

Using default HHVM settings. The HHVM is version 3.5.0, Nginx is v1.6.2.

|        PHP BENCHMARK SCRIPT        |
Start : 2015-02-12 00:03:25
Server :
PHP version : 5.6.99-hhvm
Platform : Linux
test_ifelse               : 1.541 sec.
test_math                 : 0.935 sec.
test_stringmanipulation   : 1.153 sec.
test_loops                : 2.262 sec.
Total time:               : 5.891 sec.

It took more time than any other php version. I am confused and try to repeat the test, by refreshing the page.
The first ten times, are all around 5.8 seconds. Lower 5.788, higher 6.162. The eleventh gave me a shot, it is only 1.44 seconds. I kept refresh the page and saw similar results, around 1.4 seconds.
php-bench-1second-hhvm Continue reading

How to install HHVM, Nginx, MariaDB in Ubuntu 14.04 LTS

It is just a record for reference.

0) I have my Ubuntu 14.04 installation done on my VirtualBox

512MB memory

1 CPU.

Install Ubuntu 14.04 server with openssh server only. No other server software installed.

1) Install Nginx

Nginx can be found in the Ubuntu repository, but it is often outdated. To get the latest stable version, add the following PPA to system.

sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx
sudo service nginx start

The latest version of Nginx as of this post is 1.6.2.


Enter “http://your-ip/” into web browser see the default welcome page.


Continue reading

© 2020 David Yin's Blog

Theme by Anders NorenUp ↑