Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 66e37cf

Browse files
committed
Bind PHP server to 127.0.0.1 to overcome Bad Gateway error when using 'localhost'
1 parent 4a3bb63 commit 66e37cf

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.travis.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,18 @@ matrix:
2626
# Saucelabs builds
2727
- php: 7.0
2828
env: SAUCELABS=1 BROWSER_NAME="firefox" VERSION="47.0" PLATFORM="Windows 10"
29-
before_script: php -S localhost:8000 -t tests/functional/web/ &>>./logs/php-server.log &
29+
before_script:
30+
- php -S 127.0.0.1:8000 -t tests/functional/web/ &>>./logs/php-server.log &
31+
- until $(echo | nc localhost 8000); do sleep 1; echo waiting for PHP server on port 8000...; done; echo "PHP server started"
3032
addons:
3133
sauce_connect: true
3234
jwt:
3335
secure: HPq5xFhosa1eSGnaRdJzeyEuaE0mhRlG1gf3G7+dKS0VniF30husSyrxZhbGCCKBGxmIySoAQzd43BCwL69EkUEVKDN87Cpid1Ce9KrSfU3cnN8XIb+4QINyy7x1a47RUAfaaOEx53TrW0ShalvjD+ZwDE8LrgagSox6KQ+nQLE=
3436
- php: 7.0
3537
env: SAUCELABS=1 BROWSER_NAME="chrome" VERSION="latest" PLATFORM="Windows 10"
36-
before_script: php -S localhost:8000 -t tests/functional/web/ &>>./logs/php-server.log &
38+
before_script:
39+
- php -S 127.0.0.1:8000 -t tests/functional/web/ &>>./logs/php-server.log &
40+
- until $(echo | nc localhost 8000); do sleep 1; echo waiting for PHP server on port 8000...; done; echo "PHP server started"
3741
addons:
3842
sauce_connect: true
3943
jwt:
@@ -66,8 +70,9 @@ before_script:
6670
- sh -e /etc/init.d/xvfb start
6771
- if [ ! -f jar/selenium-server-standalone-3.1.0.jar ]; then wget -q -t 3 -P jar https://selenium-release.storage.googleapis.com/3.1/selenium-server-standalone-3.1.0.jar; fi
6872
- /usr/lib/jvm/java-8-oracle/bin/java -Dwebdriver.firefox.marionette=false -jar jar/selenium-server-standalone-3.1.0.jar -log ./logs/selenium.log &
69-
- until $(echo | nc localhost 4444); do sleep 1; echo waiting for selenium-server...; done
70-
- php -S localhost:8000 -t tests/functional/web/ &>>./logs/php-server.log &
73+
- until $(echo | nc localhost 4444); do sleep 1; echo Waiting for Selenium server on port 4444...; done; echo "Selenium server started"
74+
- php -S 127.0.0.1:8000 -t tests/functional/web/ &>>./logs/php-server.log &
75+
- until $(echo | nc localhost 8000); do sleep 1; echo waiting for PHP server on port 8000...; done; echo "PHP server started"
7176

7277
script:
7378
- if [ -n "$SAUCELABS" ]; then EXTRA_PARAMS="--exclude-group exclude-saucelabs"; fi

0 commit comments

Comments
 (0)