Installing SourceGuardian in DirectAdmin: Step-by-Step Guide
در این مقاله، نحوه نصب SourceGuardian Loader بر روی سرورهای DirectAdmin به صورت گام‌به‌گام آموزش داده می‌شود. این راهنما شامل بررسی پیش‌نیازها، مراحل نصب، تنظیمات امنیتی و رفع مشکلات رایج است.

How to install SourceGuardian in DirectAdmin

In this article, we will teach you how to install SourceGuardian on your DirectAdmin control panel. This guide will help you use PHP encryption securely and efficiently. Specifically, it will cover tips for different PHP versions and server environments.
0 Shares
0
0
0
0

 

How do I install SourceGuardian directly on DirectAdmin?

In this guide Step by step We will explain how to install SourceGuardian Loaders for various SAPIs (CLI, PHP-FPM, Apache/LiteSpeed) in the DirectAdmin control panel. This article is suitable for server administrators, PHP developers, VPS/Cloud server users, and companies that use SourceGuardian encrypted PHP files.

 

Prerequisites (before you start)

Before anything else Make sure the following is available:

  • SSH access to the server with the user root or access sudo.
  • Knowing the installed PHP versions and enabled SAPIs (e.g. with php -v, check php-fpm or Apache/lsphp).
  • Access the SourceGuardian loaders download page: SourceGuardian Loaders.
  • If you are using CloudLinux/alt-php, specific paths like /opt/alt/... Consider.

 

Step 1 — Identify PHP version and SAPIs

For each PHP version you want to enable SourceGuardian for, you need to know:

  • PHP version (e.g. 7.4, 8.0).
  • CLI binary path and The relevant php.ini file.
  • Is PHP in the form of FPM Is it executed or mod_php/lsphp؟

Useful commands to check:

php -v
php -m | grep SourceGuardian
php -i | grep "Loaded Configuration File"
php -i | grep "extension_dir"
php -i | grep "Thread Safety"

To check the web SAPI, a file phpinfo.php Create it in public_html and then visit it in a browser.

<?php phpinfo(); ?>

In phpinfo look for things like Loaded Configuration File, extension_dir and Thread Safety Look around.

 

Step 2 — Download the appropriate loader

From the official SourceGuardian page, download the appropriate package for your operating system and architecture (e.g. Linux x86_64) and download the PHP version.

Official download link:

https://www.sourceguardian.com/loaders/

Example commands for downloading and extracting:

wget https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz
tar -xzvf loaders.linux-x86_64.tar.gz

After extraction, files like ixed.7.4.lin Or ixed.8.0.lin You will see . The exact name depends on the PHP version.

 

Step 3 — Choose the correct loader file (TS/NTS and API)

Important points when selecting a file:

  • Thread Safety: If output php -i | grep "Thread Safety"" Amount disabled Show, looking for file NTS Be; otherwise TS.
  • PHP API: API value in phpinfo() is displayed; make sure the loader file matches the PHP version API.

 

Step 4 — Copy the loader to the appropriate path

Instead of guessing the paths, use the amount extension_dir Use. Example:

EXTDIR=$(php -i | grep extension_dir | awk -F '=> ' '{print $2}')
cp ixed.7.4.lin $EXTDIR/ixed.7.4.lin
chown root:root $EXTDIR/ixed.7.4.lin
chmod 644 $EXTDIR/ixed.7.4.lin

A note about distributions:

  • CentOS/RHEL usually has paths like /usr/lib64/php/modules/ They have.
  • Debian/Ubuntu paths like /usr/lib/php/20190902/ Or similar.
  • CloudLinux/alt-php may have paths like /opt/alt/php74/usr/lib64/php/modules/ Have.

 

Step 5 — Enable Loader via php.ini or conf.d file

To load the loader from the command zend_extension Use. Example (standard method for CentOS/RedHat):

echo "zend_extension=$EXTDIR/ixed.7.4.lin" > /etc/php.d/20-sourceguardian.ini

Or if php.ini is in a different path:

echo "zend_extension=/usr/lib64/php/modules/ixed.7.4.lin" > /usr/local/php74/etc/php.d/20-sourceguardian.ini

Note: Choose the name of the ini file so that it is loaded before other dependent files; usually numeric prefixes like 10- Or 20- It is common.

 

Step 6 — Restart the relevant services

Restart the following services depending on SAPI:

  • PHP-FPM:
    systemctl restart php-fpm
    # or for separate versions
    systemctl restart php74-php-fpm
  • Apache/HTTPD web server:
    systemctl restart httpd
    # Ubuntu:
    systemctl restart apache2
  • LiteSpeed/OpenLiteSpeed:
    systemctl restart lsws

To verify the service names:

systemctl list-units | grep php
systemctl list-units | grep http

 

Step 7 — Installation Check and Troubleshooting

To check from the CLI:

php -v

You should see a reference to SourceGuardian or ixed loader in the output.

To check the web:

  • Page phpinfo() Open and look for the section related to SourceGuardian Look around.
  • From php -m Use to view modules.

 

Common errors and solutions

1) “Cannot load zend extension” error or error in logs

  • The file path is incorrect or the file does not have the proper permissions. Check with chown root:root and chmod 644 The owner and permission are set correctly.
  • The file is not suitable for the PHP architecture or version (TS vs NTS or different version).
  • SELinux may be preventing loading; check the status with getenforce Check.

2) The loader loads in the CLI but not on the web

  • Apache or PHP-FPM is probably using a different PHP version; be sure to check phpinfo() via the web and install the loader for the same version.
  • The loader ini file may not be located in the conf.d path related to the Web SAPI.

3) Multi-PHP/CloudLinux environments

  • For each alt-php or separate version, copy the loader to the corresponding path and create the appropriate ini file, then restart the associated service.

 

Security and operational tips

  • Never place the loader in web-accessible directories (public_html) Don't put it.
  • The file owner must root and access 644 To be set.
  • Only download packages from the official SourceGuardian site and check the checksum or signature if possible.
  • When upgrading PHP, don't forget to install the appropriate loader for the new version.
  • For production environments, test on the staging server first.

 

Practical example — Installation for PHP 7.4 (command summary)

wget https://www.sourceguardian.com/loaders/download/loaders.linux-x86_64.tar.gz
tar -xzvf loaders.linux-x86_64.tar.gz
EXTDIR=$(php -i | grep extension_dir | awk -F '=> ' '{print $2}')
cp ixed.7.4.lin $EXTDIR/ixed.7.4.lin
chown root:root $EXTDIR/ixed.7.4.lin
chmod 644 $EXTDIR/ixed.7.4.lin
echo "zend_extension=$EXTDIR/ixed.7.4.lin" > /etc/php.d/20-sourceguardian.ini
systemctl restart php-fpm
systemctl restart httpd
php -v

Then through the browser phpinfo() Check to see if the loader is displayed in the relevant section.

 

A note about DirectAdmin and custombuild

If you compiled or installed PHP with DirectAdmin CustomBuild, the paths php.ini and extension_dir It may be in /usr/local/php*/ or its subdirectories. Before copying the loader, for each PHP version, check the paths through that version's binary (e.g. /usr/local/php74/bin/php -i) Check and place the appropriate ini file in the folder etc/php.d Put the same version.

 

Why is it important to install SourceGuardian correctly?

Reasons why proper installation is important:

  • Applications encrypted with SourceGuardian will not run without the corresponding loader.
  • Incorrect loading may cause PHP errors or crashes, so choose the correct version and type.
  • In commercial environments, proper and secure installation of this loader will ensure continued service and maintain compatibility.

 

Related services and support

If your server has multiple PHP versions or complex configurations like CloudLinux/alt-php, the technical team can install and configure multiple PHP versions and troubleshoot specific configurations like LiteSpeed or SELinux.

Explanation of geographical coverage: Technical services can be provided across a network of over 85 global locations, including installation, testing, and configuration.

 

Frequently Asked Questions

You May Also Like
Amazon-AWS-EC2

What is Amazon EC2 (Elastic Compute Cloud) and what is its use?

In today's technology world, the need for powerful yet flexible servers is felt more than ever. Amazon has addressed part of this need with a completely cloud-based approach by offering Amazon EC2. This service is one of the main components of the Amazon Web Services (AWS) platform and allows you to launch and manage virtual servers at various scales.