OFFICIAL SETUP DOCUMENTATION

phpQ System Installation & Setup

Certified installation instructions for Ubuntu / Debian Linux, Windows Servers, and Docker containers across PHP 7.4 through PHP 8.4.

Part 1: Installing Runtime Loader on Ubuntu / Debian

Required on production web servers running protected PHP applications.

1

Deploy Loader Binary to System Library

Extract phpQ-loader-ubuntu.tar.gz and copy phpQ-nts.so (for standard Nginx/Apache Non-Thread-Safe PHP) to /usr/local/lib/phpq/:

sudo mkdir -p /usr/local/lib/phpq
sudo cp phpQ-nts.so /usr/local/lib/phpq/phpQ-nts.so
sudo chmod 755 /usr/local/lib/phpq/phpQ-nts.so
2

Configure PHP Extension (Ubuntu Standard)

Create the configuration file inside mods-available and enable it with phpenmod:

PHP_VER=$(php -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')
sudo bash -c "echo 'extension=/usr/local/lib/phpq/phpQ-nts.so' > /etc/php/$PHP_VER/mods-available/phpq.ini"
sudo phpenmod phpq
3

Restart Web Server & PHP-FPM

Restart your active daemon according to your web server stack:

# For NGINX + PHP-FPM:
sudo systemctl restart php$PHP_VER-fpm

# For APACHE (mod_php):
sudo systemctl restart apache2
4

Verify Loader Activation

Run this verification check in Terminal:

php -m | grep phpq
If the output prints phpq, your server is 100% ready to execute encoded PHP applications!

Part 2: Installing Runtime Loader on Windows (XAMPP / IIS / Apache)

Deploying the phpq.dll native loader extension on Windows x64.

1

Copy phpq.dll to PHP Extension Directory

Locate your PHP installation directory. For XAMPP, this is typically C:\xampp\php\ext\.

  • Copy phpq.dll (or php_phpq.dll) into C:\xampp\php\ext\
2

Enable Extension in php.ini

Open C:\xampp\php\php.ini in Notepad and add this line under Dynamic Extensions:

extension=phpq

* Note: Alternatively, extension=php_phpq.dll can be specified if preferred.

3

Restart Web Server & Verify

Restart Apache in XAMPP Control Panel, or run in Command Prompt (CMD):

php -m | findstr phpq

Part 3: Installing & Using phpQ Compiler CLI

For developers and build servers encrypting source code.

Linux CLI Installation

Copy the phpQ binary into your system executable path:

sudo cp phpQ /usr/local/bin/phpq
sudo chmod +x /usr/local/bin/phpq
phpq --help
→ Invoke anywhere with: phpq protect.txt

Windows Portable Suite

Extract phpQ-windows-portable.zip to any directory. No installation or registry keys required:

  • Double-click View_Help.bat for instant CLI help
  • Drag & drop protect.txt onto phpQ.exe
  • Run in CMD: phpQ.exe protect.txt
→ Includes embedded PHP 8.2 engine and sample workspace.

Part 4: Querying Server Hardware Machine ID

Retrieve the cryptographic SHA-256 fingerprint for node-locked licenses.

If your software vendor requires hardware locking, run this command directly on your production server:

php -r "echo phpq_machine_id() . PHP_EOL;"
Expected Output Example:
b857dbc162a4e36aca703dcd3008336b324e60bb87306f285090285c7b9829b1
* Bound cryptographically to the CPU ID, Motherboard UUID, and primary block device serial. Virtualized spoofing resistant.

Part 5: Production Docker Deployment

Packaging phpQ Loader inside modern containerized microservices.

Add these lines to your Dockerfile to automatically bundle and activate the phpQ loader:

# Dockerfile Example for PHP 8.2 / 8.3 FPM
FROM php:8.2-fpm-bookworm

# Copy phpQ Linux Loader binary into system library
COPY phpQ-nts.so /usr/local/lib/phpq/phpQ-nts.so
RUN chmod 755 /usr/local/lib/phpq/phpQ-nts.so

# Configure PHP extension
RUN echo "extension=/usr/local/lib/phpq/phpQ-nts.so" > /usr/local/etc/php/conf.d/phpq.ini

# Verify module loaded during container build
RUN php -m | grep phpq

# Copy your protected application code
COPY ./dist_protected /var/www/html

Part 6: Verification & Troubleshooting Guide

Diagnostics for common installation edge-cases.

Issue: "phpQ Loader not loaded" error message

Cause: The extension path is misconfigured in php.ini, or PHP-FPM / Apache was not restarted after enabling the extension.
Fix: Run php --ini to verify which php.ini is actively parsed, verify file permissions with ls -l /usr/local/lib/phpq/phpQ-nts.so, and restart your PHP-FPM service.

Issue: Thread Safety (ZTS vs NTS) mismatch

Cause: Loading NTS extension into a ZTS (Thread Safe) PHP runtime or vice versa.
Fix: Run php -i | grep "Thread Safety". If enabled, deploy phpQ-ts.so. Standard Nginx and Apache FPM configurations always use Non-Thread-Safe (phpQ-nts.so).

Issue: SELinux blocking extension on RHEL / CentOS / AlmaLinux

Cause: SELinux security context denies web server execution.
Fix: Run: sudo chcon -t textrel_shlib_t /usr/local/lib/phpq/phpQ-nts.so or sudo restorecon -Rv /usr/local/lib/phpq/.

Ready to Start Encoding?

Check out the comprehensive Developer Usage Manual for compilation commands, protect.txt configuration options, and cryptographic license generation.