Skip to content

Commit 6aece42

Browse files
mdt-36253: Setup php-spx. (#11)
1 parent a519b78 commit 6aece42

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

assets/lando/setup_php_spx.sh

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
# Check if PHP_SPX environment variable exists and if its value is 1
4+
if [ "${PHP_SPX}" = "1" ]; then
5+
apt-get install zlib1g-dev
6+
cd ~
7+
git clone https://github.com/NoiseByNorthwest/php-spx.git
8+
cd php-spx
9+
git checkout release/latest
10+
phpize
11+
./configure
12+
make
13+
make install
14+
docker-php-ext-enable spx
15+
# Configure default configuration for SPX
16+
SPX_INI="/usr/local/etc/php/conf.d/docker-php-ext-spx.ini"
17+
{
18+
echo "extension=spx.so"
19+
echo "spx.http_enabled=1"
20+
echo "spx.http_key=\"dev\""
21+
echo "spx.http_ip_whitelist=\"*\""
22+
echo "spx.http_trusted_proxies=\"*\""
23+
} | tee ${SPX_INI}
24+
/etc/init.d/apache2 reload
25+
else
26+
echo "PHP_SPX is not set to 1 or not present. Skipping SPX installation."
27+
fi

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
".lando/fresh-install.sh": "assets/lando/fresh-install.sh",
5252
".lando/setup_terminus.sh": "assets/lando/setup_terminus.sh",
5353
".lando/verify_mac_ssh_socket.sh": "assets/lando/verify_mac_ssh_socket.sh",
54+
".lando/setup_php_spx.sh": "assets/lando/setup_php_spx.sh",
5455
".gitignore": "assets/misc/gitignore",
5556
"pantheon.upstream.yml": {
5657
"path": "assets/pantheon/pantheon.upstream.yml",

0 commit comments

Comments
 (0)