Part 1: Installing Runtime Loader on Ubuntu / Debian
Required on production web servers running protected PHP applications.
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
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
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
Verify Loader Activation
Run this verification check in Terminal:
php -m | grep phpq
Part 2: Installing Runtime Loader on Windows (XAMPP / IIS / Apache)
Deploying the phpq.dll native loader extension on Windows x64.
Copy phpq.dll to PHP Extension Directory
Locate your PHP installation directory. For XAMPP, this is typically C:\xampp\php\ext\.
- Copy
phpq.dll(orphp_phpq.dll) intoC:\xampp\php\ext\
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.
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
phpq protect.txt
Windows Portable Suite
Extract phpQ-windows-portable.zip to any directory. No installation or registry keys required:
- Double-click
View_Help.batfor instant CLI help - Drag & drop
protect.txtontophpQ.exe - Run in CMD:
phpQ.exe protect.txt
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;"
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.
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.
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).
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.