Some Web Hosting instances, such as those running enhanced versions of Linux, allow you to configure PHP and Zend extensions. This feature helps you expand your website's functionality, enhance its security, and access the latest capabilities to better manage and maintain your site. This document shows you how to configure PHP and Zend extensions.
Prerequisites
-
You have an FTP client installed. We recommend using FileZilla.
-
You have the sg11 encryption component package.
-
You have the ionCube Loader encryption component package. You can also download it from the ionCube official website.
Procedure
Web Hosting instances that run enhanced versions of Linux support the configuration of PHP and Zend extensions. For other instance types, such as those running non-enhanced Linux or any version of Windows, check your console to determine if this feature is available.
This document uses the SourceGuardian (sg11), ionCube Loader, and libsodium encryption components as examples. You can configure extensions in two ways: by using a user-added extension or one provided by the platform.
Configure a user-added extension
You can provide your own PHP or Zend extensions. First, use an FTP client to upload the extension files to the myfolder directory on your Web Hosting instance. After the upload is complete, you can find and load the extension from the PHP and Zend Extensions page.
-
Use FileZilla to connect to your Linux-based Web Hosting instance.
For detailed instructions, see Manage website files by using FileZilla.
-
Upload the extension to the myfolder directory of your Web Hosting instance.
-
PHP extension: This example uses the SourceGuardian (sg11) encryption component. The process is similar for other PHP extensions.
-
On your local host, extract the sg11 encryption component package.
-
Drag the extracted sg11 folder (for example, named sg11_Linux) to the myfolder directory of your website.
-
-
Zend extension: This example uses the ionCube Loader encryption component. The process is similar for other Zend extensions.
-
On your local host, extract the ionCube Loader encryption component package.
NoteEnsure that the extracted folder contains the component files directly and is not nested within another folder. If it is, use the inner folder.
-
Drag the extracted ionCube Loader folder (for example, named ioncube) to the myfolder directory of your website.
-
-
-
Log on to the Web Hosting console.
-
Find the Web Hosting instance and click Manage in the Actions column.
-
In the left-side navigation pane, choose .
-
In the Important dialog box that appears, read the message and click Confirm.
-
On the PHP and Zend Extensions page, in the Extension Directory area, click myfolder directory.
The Extension Directory area contains the User-added Extensions and Platform-provided Extensions tabs. When configuring a non-open-source extension, keep the default User-added Extensions tab selected.
-
Load the extension file.
PHP extension
This example uses the ixed.7.0.lin file from the sg11 component.
Note-
Each file can be loaded only once. Compressed files cannot be loaded.
-
Ensure that the PHP version of the Web Hosting instance matches the version of the file that you want to load. For example, if the Web Hosting instance uses PHP 7.0, you must select the ixed.7.0.lin file to load. The 7.0 in ixed.7.0.lin indicates the version number of the file. For more information about how to view or change the PHP version, see Change the PHP version.
-
In the Extension Directory area, click the sg11 folder name (for example, sg11_Linux).
-
Find the ixed.7.0.lin file and click Load in the Actions column.
-
In the dialog box that appears, enter a name for the extension in the input field (for example, sg-php7.0) and click Confirm.
After the configuration is complete, the Loaded Extensions area displays information about the loaded ixed.7.0.lin file. The extension name is displayed as sg-php7.0, and a Delete button is available in the Actions column.
Zend extension
This example uses the ioncube_loader_lin_7.0.so file from the ionCube Loader component.
Note-
Each file can be loaded only once. Compressed files cannot be loaded.
-
Ensure that the PHP version of your Web Hosting instance matches the version of the file that you want to load. For example, if your Web Hosting instance uses PHP 7.0, you must select the ioncube_loader_lin_7.0.so file to load. The 7.0 in ioncube_loader_lin_7.0.so indicates the version number of the file. For more information about how to view or change the PHP version, see Change the PHP version.
-
In the Extension Directory area, click the ionCube Loader folder name (for example, ioncube).
-
Find the ioncube_loader_lin_7.0.so file and click Load in the Actions column.
-
In the dialog box that appears, enter a name for the extension (for example, ioncube7.0) and click Confirm.
After the configuration is complete, the Loaded Extensions area displays information about the loaded ioncube_loader_lin_7.0.so file.
NoteThe suffix
(zend_extension)is automatically added to the name of a Zend extension to identify its type.The list shows two loaded extensions: ioncube7.0(zend_extension) and sg-php7.0. A Delete button is available for each extension.
-
Configure a platform-provided extension
This section uses the libsodium 2.0.23 encryption component as an example. You do not need to prepare or upload platform-provided extensions. The extensions available in the Web Hosting console already match your instance's current PHP version. Simply load them. If you change the PHP version of your instance, any loaded extensions are automatically deleted.
The platform provides only open-source extensions. The specific extensions available depend on what is displayed in your Web Hosting console.
-
Log on to the Web Hosting console.
-
Find the Web Hosting instance and click Manage in the Actions column.
-
In the Important dialog box that appears, read the message and click Confirm.
-
On the PHP and Zend Extensions page, in the Extension Directory area, click the Platform-provided Extensions tab.
-
In the list of extensions, find libsodium and click Load in the Actions column.
The Platform-provided Extensions list displays the available open-source extensions. A Load button is available for each extension.
After the extension is successfully loaded, the Loaded Extensions area displays its information. The list shows that libsodium 2.0.23 has been loaded.
NoteIf the extension fails to load, submit a ticket for assistance.
Delete an extension
If you no longer need a PHP or Zend extension, you can delete it from your Web Hosting instance.
When you delete an extension, its features are disabled. To restore them, you must load the extension again.
-
In the Loaded Extensions area, find the extension you want to delete and click Delete in the Actions column.
-
In the confirmation dialog box that appears, click Confirm.
Next steps
After loading an extension, use the phpinfo() function to verify the configuration.
-
Use FileZilla to reconnect to your Linux-based Web Hosting instance.
-
In the /htdocs directory, right-click an empty area and select Create new file(T).
-
In the dialog box that appears, enter a filename (for example, test.php) and click OK(O).
-
Select the test.php file, right-click it, and select View/Edit(V). Enter the following code and save the file.
<?php phpinfo(); ?> -
In a web browser, navigate to http://your_domain_name/test.php and press Enter.
NoteIf you cannot use your domain name for reasons such as a pending ICP filing, you can use the temporary domain name provided for your instance.
-
On the page returned by the
phpinfo()function, search for the extension's name.-
PHP extension: To verify that the sg11 extension was configured successfully, search for SourceGuardian. If a module with this name appears, the configuration is successful. The page displays the version number and configuration details for the SourceGuardian module.
ImportantIf you cannot find any information for SourceGuardian, the configuration has failed. submit a ticket for assistance.
-
Zend extension: To verify that the ionCube Loader extension was configured successfully, search for ionCube Loader. If a module with this name appears, the configuration is successful. The page displays the version number and configuration details for the ionCube PHP Loader module.
ImportantIf you cannot find any information for ionCube Loader, the configuration has failed. submit a ticket for assistance.
-
Related documents
Linux-based Web Hosting instances come with several common extensions configured by default. For more information, see Console FAQs.