Skip to content

Instantly share code, notes, and snippets.

@tiagohillebrandt
Created October 31, 2025 00:40
Show Gist options
  • Select an option

  • Save tiagohillebrandt/aadbfe69c7b8339e85cdc4b121437ef7 to your computer and use it in GitHub Desktop.

Select an option

Save tiagohillebrandt/aadbfe69c7b8339e85cdc4b121437ef7 to your computer and use it in GitHub Desktop.
Install PHP-SPX extension on PHP 8.0

1. Compile PHP-SPX on PHP 8.0

git clone https://github.com/NoiseByNorthwest/php-spx.git
cd php-spx
git checkout release/latest
phpize8.0
./configure --with-php-config=/usr/bin/php-config8.0
make
sudo make install

2. Add the below content to the spx.ini file:

vim /etc/php/8.0/mods-available/spx.ini
extension=spx.so

spx.http_enabled=1
spx.http_key="dev"
spx.http_ip_whitelist=*
spx.http_trusted_proxies=*
spx.http_ui=1
spx.storage=/tmp/spx
spx.storage_size=20

3. Enable the SPX extension:

phpenmod -v 8.0 -s ALL spx

4. Restart the PHP-FPM service:

systemctl restart php8.0-fpm

5. To use it via PHP-CLI, just add the SPX_ENABLED variable to the beginning of the command. Here's an example using WP-CLI:

SPX_ENABLED=1 wp plugin list

6. If you want to access it via your browser, just append the following query string to your site:

?SPX_KEY=dev&SPX_UI_URI=/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment