Translated using Weblate (Portuguese)
[phpmyadmin.git] / test / start-local-server
blobdc38bb9edb775934e22aa36a4a554cdb769cfa41
1 #!/bin/sh
3 # Do not run as CGI
4 if [ -n "$GATEWAY_INTERFACE" ] ; then
5 echo 'Can not invoke as CGI!'
6 exit 1
7 fi
9 set -e
10 set -x
12 if [ "$CI_MODE" != "selenium" -o -z "$TESTSUITE_BROWSERSTACK_KEY" ] ; then
13 exit 0
16 # Start php-fpm + nginx in temporary dir
17 DIR=`mktemp -d`
18 CURRENT=`pwd`
19 PHP_VERSION=$(phpenv version-name)
21 # Create configuration with correct paths
22 cp test/nginx.conf test/php-fpm.conf test/php.ini $DIR/
23 sed -i -e "s@%DIR%@$DIR@" -e "s@%ROOT%@$CURRENT@" $DIR/*
24 mkdir $DIR/sessions
26 # Start servers
27 $HOME/.phpenv/versions/$PHP_VERSION/sbin/php-fpm --fpm-config $DIR/php-fpm.conf -c $DIR/php.ini
28 nginx -c $DIR/nginx.conf
30 # Start BrowserStack Local forwarder
31 ~/browserstack/BrowserStackLocal -localIdentifier "travis-$TRAVIS_JOB_NUMBER" -onlyAutomate "$TESTSUITE_BROWSERSTACK_KEY" 127.0.0.1,8000,0 &