diff --git a/.devilbox/www/include/lib/Postgres.php b/.devilbox/www/include/lib/Postgres.php
index c65aef5c..7897f17c 100644
--- a/.devilbox/www/include/lib/Postgres.php
+++ b/.devilbox/www/include/lib/Postgres.php
@@ -55,7 +55,7 @@ class Postgres
// Silence errors and try to connect
error_reporting(0);
- $link = pg_pconnect('host='.$host.' user='.$user.' password='.$pass);
+ $link = pg_connect('host='.$host.' user='.$user.' password='.$pass);
error_reporting(-1);
if (!$link || pg_connection_status($link) !== PGSQL_CONNECTION_OK) {
@@ -126,10 +126,10 @@ class Postgres
// Silence errors and try to connect
error_reporting(0);
if ($database !== null) {
- $link = pg_pconnect('host='.$host.' dbname='.$database.' user='.$user.' password='.$pass);
+ $link = pg_connect('host='.$host.' dbname='.$database.' user='.$user.' password='.$pass);
} else {
// NOTE: using dbname=postgres prevents HHVM from segfaulting
- $link = pg_pconnect('host='.$host.' dbname=postgres user='.$user.' password='.$pass);
+ $link = pg_connect('host='.$host.' user='.$user.' password='.$pass);
}
error_reporting(-1);
diff --git a/.tests/.lib.sh b/.tests/.lib.sh
index 468c5427..3c8259c7 100644
--- a/.tests/.lib.sh
+++ b/.tests/.lib.sh
@@ -398,7 +398,7 @@ debilbox_test() {
# Get actual versions
echo "http://localhost settings"
echo "------------------------------------------------------------"
- curl -q localhost 2>/dev/null | grep -E '
.*
' | sed 's/.*//g' | sed 's/<\/h3>//g'
+ curl -q http://localhost/index.php 2>/dev/null | grep -E '.*
' | sed 's/.*//g' | sed 's/<\/h3>//g'
echo
@@ -440,7 +440,7 @@ debilbox_test() {
print_h2 "4. Error output"
echo "Curl"
echo "------------------------------------------------------------"
- curl localhost
+ curl -vv http://localhost/index.php || true
echo
echo "docker-compose ps"
@@ -448,7 +448,19 @@ debilbox_test() {
docker-compose ps
echo
+ echo "docker-compose logs"
+ echo "------------------------------------------------------------"
+ docker-compose logs
+ echo
+
+ echo "log files"
+ echo "------------------------------------------------------------"
+ ls -lap log/
+ sudo find log -type f -exec sh -c 'echo "{}:\n-----------------"; cat "{}"; echo "\n\n"' \;
+
return 1
+
+
fi
return 0
@@ -460,9 +472,9 @@ debilbox_test() {
###
_test_docker_compose() {
- _broken="$( docker-compose ps | grep -c 'Exit' )"
- _running="$( docker-compose ps | grep -c 'Up' )"
- _total="$( docker-compose ps -q | grep -c '' )"
+ _broken="$( docker-compose ps | grep -c 'Exit' || true )"
+ _running="$( docker-compose ps | grep -c 'Up' || true )"
+ _total="$( docker-compose ps -q | grep -c '' || true )"
if [ "${_broken}" != "0" ]; then
return 1
@@ -482,7 +494,19 @@ _test_docker_compose() {
_test_curled_oks() {
_oks="${1}"
- _count="$( curl -q localhost 2>/dev/null | grep -c OK )"
+ max="20"
+ i=0
+ while [ $i -lt $max ]; do
+ if [ "$( curl -s -o /dev/null -w '%{http_code}' http://localhost/index.php )" != "404" ]; then
+ break;
+ fi
+ sleep 1s
+ i=$(( i + 1 ))
+ done
+
+ # sleep (in case hhvm segfaulted and needs to be restarted)
+ sleep 10
+ _count="$( curl -q http://localhost/index.php 2>/dev/null | grep -c 'OK' || true )"
echo "${_count}"
if [ "${_count}" != "${_oks}" ]; then
diff --git a/.tests/test_single.sh b/.tests/test_single.sh
index 64188616..5dee605d 100755
--- a/.tests/test_single.sh
+++ b/.tests/test_single.sh
@@ -67,8 +67,8 @@ set_host_port_pgsql "54320"
###
### Docker default versions to use
###
-_httpd="apache-2.2"
-_mysql="mariadb-10.2"
+_httpd="nginx-stable"
+_mysql="mariadb-10.1"
_pgsql="9.6"
_php="php-fpm-7.0"
diff --git a/README.md b/README.md
index ee3d0757..00bb0f6b 100644
--- a/README.md
+++ b/README.md
@@ -87,6 +87,8 @@ No need to install and configure different versions locally. Simply choose your
| | [![Build Status](https://travis-ci.org/cytopia/docker-mariadb-10.1.svg?branch=master)](https://travis-ci.org/cytopia/docker-mariadb-10.1) [MariaDB 10.1](https://github.com/cytopia/docker-mariadb-10.1) | | [![Build Status](https://travis-ci.org/cytopia/docker-hhvm-latest.svg?branch=master)](https://travis-ci.org/cytopia/docker-hhvm-latest) [HHVM latest](https://github.com/cytopia/docker-hhvm-latest)
| | [![Build Status](https://travis-ci.org/cytopia/docker-mariadb-10.2.svg?branch=master)](https://travis-ci.org/cytopia/docker-mariadb-10.2) [MariaDB 10.2](https://github.com/cytopia/docker-mariadb-10.2) | |
+**Incompatible choices:**
+- Apache 2.2 and HHVM do not work together
**Optional NoSQL stack**
diff --git a/env-example b/env-example
index 1a36e1d8..39854bde 100644
--- a/env-example
+++ b/env-example
@@ -63,8 +63,8 @@ LOCAL_LISTEN_ADDR=127.0.0.1:
### 1.1 Choose HTTP Server Image
###
#HTTPD_SERVER=apache-2.2
-HTTPD_SERVER=apache-2.4
-#HTTPD_SERVER=nginx-stable
+#HTTPD_SERVER=apache-2.4
+HTTPD_SERVER=nginx-stable
#HTTPD_SERVER=nginx-mainline
###