From 04707cbf8dda006bbc3dcd892e61b2b6f96fda97 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 29 Mar 2014 11:52:37 +0100 Subject: [PATCH 1/6] [ticket/12318] Correctly setup HHVM for functional tests. PHPBB3-12318 --- travis/setup-webserver.sh | 79 ++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 34 deletions(-) diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh index f1bf69c575..d9c6b370a1 100755 --- a/travis/setup-webserver.sh +++ b/travis/setup-webserver.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# @copyright (c) 2013 phpBB Group +# @copyright (c) 2014 phpBB Group # @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 # set -e @@ -12,44 +12,55 @@ sudo apt-get install -y nginx realpath sudo service nginx stop DIR=$(dirname "$0") -PHPBB_ROOT_PATH=$(realpath "$DIR/../phpBB") - -NGINX_CONF="/etc/nginx/sites-enabled/default" - -PHP_FPM_BIN="$HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/sbin/php-fpm" -PHP_FPM_CONF="$DIR/php-fpm.conf" -PHP_FPM_SOCK=$(realpath "$DIR")/php-fpm.sock - USER=$(whoami) +PHPBB_ROOT_PATH=$(realpath "$DIR/../phpBB") +NGINX_CONF="/etc/nginx/sites-enabled/default" +APP_SOCK=$(realpath "$DIR")/php-app.sock -# php-fpm configuration +if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] +then + HHVM_LOG=$(realpath "$DIR")/hhvm.log + + sudo hhvm \ + --mode daemon \ + --user "$USER" \ + -vServer.Type=fastcgi \ + -vServer.FileSocket="$APP_SOCK" \ + -vLog.File="$HHVM_LOG" +else + # php-fpm + PHP_FPM_BIN="$HOME/.phpenv/versions/$TRAVIS_PHP_VERSION/sbin/php-fpm" + PHP_FPM_CONF="$DIR/php-fpm.conf" + + echo " + [global] + + [travis] + user = $USER + group = $USER + listen = $APP_SOCK + pm = static + pm.max_children = 2 + + php_admin_value[memory_limit] = 128M + " > $PHP_FPM_CONF + + sudo $PHP_FPM_BIN \ + --fpm-config "$DIR/php-fpm.conf" +fi + +# nginx echo " -[global] + server { + listen 80; + root $PHPBB_ROOT_PATH/; + index index.php index.html; -[travis] -user = $USER -group = $USER -listen = $PHP_FPM_SOCK -pm = static -pm.max_children = 2 - -php_admin_value[memory_limit] = 128M -" > $PHP_FPM_CONF - -# nginx configuration -echo " -server { - listen 80; - root $PHPBB_ROOT_PATH/; - index index.php index.html; - - location ~ \.php { - fastcgi_pass unix:$PHP_FPM_SOCK; - include fastcgi_params; + location ~ \.php { + fastcgi_pass unix:$APP_SOCK; + include fastcgi_params; + } } -} " | sudo tee $NGINX_CONF > /dev/null -# Start daemons -sudo $PHP_FPM_BIN --fpm-config "$DIR/php-fpm.conf" sudo service nginx start From 672eab3a9c8b2c2651038fbc2a31d523fe0ff067 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 29 Mar 2014 17:50:15 +0100 Subject: [PATCH 2/6] [ticket/12318] Upgrade to a recent stable version of HHVM. PHPBB3-12318 --- travis/setup-webserver.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh index d9c6b370a1..6612b2c4bb 100755 --- a/travis/setup-webserver.sh +++ b/travis/setup-webserver.sh @@ -19,6 +19,9 @@ APP_SOCK=$(realpath "$DIR")/php-app.sock if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] then + # Upgrade to a recent stable version of HHVM + sudo apt-get install -y hhvm + HHVM_LOG=$(realpath "$DIR")/hhvm.log sudo hhvm \ From a53312636a02797d7856a381f580e5969b131700 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 30 Mar 2014 01:06:08 +0100 Subject: [PATCH 3/6] [ticket/12318] Add PPA providing dependencies for recent HHVM on Ubuntu 12.04. PHPBB3-12318 --- travis/setup-webserver.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh index 6612b2c4bb..68134872f9 100755 --- a/travis/setup-webserver.sh +++ b/travis/setup-webserver.sh @@ -6,6 +6,12 @@ set -e set -x +if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] +then + # Add PPA providing dependencies for recent HHVM on Ubuntu 12.04. + sudo add-apt-repository -y ppa:mapnik/boost +fi + sudo apt-get update sudo apt-get install -y nginx realpath From d53c411d90700c751cf1f4980e13868752698406 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 30 Mar 2014 01:43:11 +0100 Subject: [PATCH 4/6] [ticket/12318] Always install new config file on HHVM upgrade conflict. PHPBB3-12318 --- travis/setup-webserver.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh index 68134872f9..5bc0feae88 100755 --- a/travis/setup-webserver.sh +++ b/travis/setup-webserver.sh @@ -26,7 +26,7 @@ APP_SOCK=$(realpath "$DIR")/php-app.sock if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] then # Upgrade to a recent stable version of HHVM - sudo apt-get install -y hhvm + sudo apt-get -o Dpkg::Options::="--force-confnew" install -y hhvm HHVM_LOG=$(realpath "$DIR")/hhvm.log From e1be4943d8b8840f05d9a2b9781d85322050977b Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 30 Mar 2014 01:50:46 +0100 Subject: [PATCH 5/6] [ticket/12318] Pin HHVM version to 3.0.0~precise. PHPBB3-12318 --- travis/setup-webserver.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh index 5bc0feae88..0dceead565 100755 --- a/travis/setup-webserver.sh +++ b/travis/setup-webserver.sh @@ -26,7 +26,8 @@ APP_SOCK=$(realpath "$DIR")/php-app.sock if [ "$TRAVIS_PHP_VERSION" = 'hhvm' ] then # Upgrade to a recent stable version of HHVM - sudo apt-get -o Dpkg::Options::="--force-confnew" install -y hhvm + sudo apt-get -o Dpkg::Options::="--force-confnew" \ + install -y hhvm=3.0.0~precise HHVM_LOG=$(realpath "$DIR")/hhvm.log From 297729aa324710f9547fb5dc7a8bbcdf85049d21 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 30 Mar 2014 03:37:25 +0200 Subject: [PATCH 6/6] [ticket/12318] Use MySQL instead of MySQLi for now on HHVM. PHPBB3-12318 --- travis/setup-webserver.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh index 0dceead565..9802fab749 100755 --- a/travis/setup-webserver.sh +++ b/travis/setup-webserver.sh @@ -29,6 +29,10 @@ then sudo apt-get -o Dpkg::Options::="--force-confnew" \ install -y hhvm=3.0.0~precise + # MySQLi is broken in HHVM 3.0.0~precise and still does not work for us in + # 2014.03.28~saucy, i.e. needs more work. Use MySQL extension for now. + sed -i "s/mysqli/mysql/" "$DIR/phpunit-mysql-travis.xml" + HHVM_LOG=$(realpath "$DIR")/hhvm.log sudo hhvm \