Which PHP extensions and configuration options are supported at Hostinger

Learn which PHP extensions and configuration options Hostinger web and cloud hosting plans support.

Updated 5 days ago

Most PHP extensions and configuration options at Hostinger are enabled by default on Web and Cloud hosting plans, with a couple of security-sensitive exceptions you can turn on manually when needed. SimpleXML, PHP SOAP, MCrypt, Zend OPcache, ionCube, and allow_url_fopen all fall into the “on by default” group, while dl() is off by default for security reasons and the legacy magic_quotes_gpc directive needs to be disabled through .htaccess. Each is covered individually below. For the specific resource limits of each plan type, see parameters and limits of hosting plans in Hostinger.

Is SimpleXML supported at Hostinger?

SimpleXML is a PHP extension that offers a user-friendly approach to handling XML data in PHP, eliminating the need for manual XML parsing or reliance on more intricate DOM (Document Object Model) methods. It does this by establishing a tree-based interface that makes it easier to access and modify XML elements, attributes, and nodes.

SimpleXML is enabled by default on all Web and Cloud hosting plans. You can check it in the PHP Configuration section of hPanel.

Is PHP SOAP enabled at Hostinger?

PHP SOAP (Simple Object Access Protocol) is a protocol used to exchange information using XML, allowing programs running on different operating systems and platforms to communicate with each other smoothly.

SOAP is supported on all Web and Cloud hosting plans and is enabled by default in the PHP configuration. This setting can be changed at any time through PHP Configuration in hPanel.

Is dl() enabled at Hostinger?

The dl() function in PHP is used to dynamically load a PHP extension at runtime within a script, allowing the inclusion of a shared library or extension file that extends PHP functionality.

Since dl() can potentially load arbitrary or malicious code, it’s disabled by default on Web and Cloud hosting plans. If needed, it can be enabled manually from hPanel.

We recommend considering the following precautions:

  • Ensure you’re using the latest PHP version available

  • Implement strict input validation and sanitization measures to safeguard against potential security threats

  • Limit the use of dl() exclusively to specific directories or scripts that require dynamic loading of extensions

While these precautions can help reduce the risks associated with using dl(), it’s generally advisable to avoid its usage and, if possible, seek alternative solutions to maintain a more secure hosting environment.

Is Mcrypt supported at Hostinger?

Yes, MCrypt is supported. Keep in mind that MCrypt was deprecated in PHP v7.1 and is no longer supported in PHP v7.2 and later versions. You can still use the MCrypt module in older PHP versions.

Are Zend OPcache and ionCube supported at Hostinger?

Zend OPcache (formerly Zend Optimizer) and ionCube Loader are pre-installed on all Web and Cloud hosting plans at Hostinger, but they need to be enabled per website by enabling the PHP extension.

IonCube is not available for PHP version 8, however, it’s available for version 8.1 and above.

Is allow_url_fopen enabled at Hostinger?

The `allow_url_fopen` PHP function is enabled by default on all Web and Cloud hosting plans.

Can the magic_quotes_gpc directive be disabled at Hostinger?

Yes. The legacy magic_quotes_gpc directive can be disabled by adding a line to the .htaccess file in the directory where you want it disabled.

  1. Open the .htaccess file using the File Editor. If the file doesn’t exist in the public_html folder of your website, create it.
  2. Add the following line:
    php_flag magic_quotes_gpc off
  3. Click Save to apply the changes.

Is the php.ini file accessible at Hostinger?

Due to the hosting environment architecture of Web and Cloud hosting plans, direct access to the php.ini file is disabled.

Instead, you can modify settings such as memory_limit, error_reporting, and maximum file upload sizes through the PHP Options section of hPanel, or by adding php_flag directives to your .htaccess file.

If you need full access to the php.ini file and all its settings, VPS Hosting is the best option, since it’s a self-managed solution with full control over server configuration.

Can ModSecurity be disabled at Hostinger?

ModSecurity is an open-source web application firewall (WAF) that protects websites from threats such as SQL injection and cross-site scripting. It’s enabled by default at Hostinger, and we recommend keeping it enabled — but you may need to disable it in some cases, such as fixing compatibility issues with a script, plugin, or widget.

  1. Open the .htaccess file of your website using the File Manager, or create one if it doesn’t exist.
  2. Add the following lines:
    SecFilterEngine Off
    SecFilterScanPOST Off
  3. Save the changes. ModSecurity will now be disabled for your website.

Most PHP extensions and settings covered here are already enabled by default on Web and Cloud hosting plans, with configuration handled through PHP Configuration in hPanel. The main exceptions are dl(), which is off by default for security and needs to be enabled manually, and magic_quotes_gpc, a legacy directive managed through .htaccess rather than the PHP Configuration panel. ModSecurity is enabled by default and can be disabled through .htaccess if needed, while the php.ini file itself isn’t directly accessible on Web and Cloud plans — VPS Hosting is required for full access.

Additional resources