From 6afbe00dd6330801199964a385d4efbb04464d25 Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Tue, 11 Feb 2020 23:52:07 +0100 Subject: [PATCH] Custom php.ini for webserver --- test/Context/ProcessWebTest.php | 2 +- travis/install-pthreads.sh | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) mode change 120000 => 100755 travis/install-pthreads.sh diff --git a/test/Context/ProcessWebTest.php b/test/Context/ProcessWebTest.php index a2e0087..9f4332d 100644 --- a/test/Context/ProcessWebTest.php +++ b/test/Context/ProcessWebTest.php @@ -16,7 +16,7 @@ class ProcessWebTest extends AsyncTestCase private static $proc; public static function setUpBeforeClass(): void { - self::$proc = \proc_open(self::locateBinary()." -S localhost:8080", [2 => ['pipe', 'r']], $pipes, $root = \realpath(__DIR__.'/../../')); + self::$proc = \proc_open(self::locateBinary()." -S localhost:8080", [2 => ['pipe', 'r']], $pipes, $root = \realpath(__DIR__.'/../../'), ['PHPRC' => '/tmp']); while (!@\file_get_contents('http://localhost:8080/composer.json')) { \usleep(500); } diff --git a/travis/install-pthreads.sh b/travis/install-pthreads.sh deleted file mode 120000 index a7b81ea..0000000 --- a/travis/install-pthreads.sh +++ /dev/null @@ -1 +0,0 @@ -../vendor/amphp/sync/travis/install-pthreads.sh \ No newline at end of file diff --git a/travis/install-pthreads.sh b/travis/install-pthreads.sh new file mode 100755 index 0000000..d2f6eb2 --- /dev/null +++ b/travis/install-pthreads.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +git clone https://github.com/krakjoe/pthreads; +pushd pthreads; +git checkout master; +phpize; +./configure; +make; +make install; +popd; +cp "$(php -r 'echo php_ini_loaded_file();')" /tmp +echo "extension=pthreads.so" >> "$(php -r 'echo php_ini_loaded_file();')"