---
title: How to install PHP modules (Debian/Ubuntu)
description: "First, you need to create and place a phpinfo.php script in the site directory to get information about PHP parameters on the server. 1. Connect to the server via SSH. 2. Go to the site directory:  3."
---

[Skip to content](https://help.ishosting.com/en/how-to-install-php-modules-debian-ubuntu#main-content)

- [English](https://help.ishosting.com/en/how-to-install-php-modules-debian-ubuntu)
- [Русский](https://help.ishosting.com/ru/how-to-install-php-modules-debian-ubuntu)

English

Show submenu for translations

[![is\*hosting](https://help.ishosting.com/hubfs/Logo_Ishosting_mono-1.svg)](https://help.ishosting.com/en)

- [Blog](https://blog.ishosting.com/en)
- [Support](https://my.ishosting.com/en/tickets)

Open main navigation

Close main navigation

- [Blog](https://blog.ishosting.com/en)
- [Support](https://my.ishosting.com/en/tickets)
- - [English](https://help.ishosting.com/en/how-to-install-php-modules-debian-ubuntu)
    - [Русский](https://help.ishosting.com/ru/how-to-install-php-modules-debian-ubuntu)

  English
  
  Show submenu for translations
- [Go to ishosting.com](https://ishosting.com/)

[Go to ishosting.com](https://ishosting.com/)

 Hello. How can we help you?

- There are no suggestions because the search field is empty.

1. [Help Center](https://help.ishosting.com/en)
2. [Server Administration](https://help.ishosting.com/en/server-administration)
3. [UNIX Instructions](https://help.ishosting.com/en/server-administration#unix-instructions)

# How to install PHP modules (Debian/Ubuntu)

### Phpinfo script creation

First, you need to create and place a phpinfo.php script in the site directory to get information about PHP parameters on the server.

1\. Connect to the server via SSH.

2\. Go to the site directory:

```
cd path/to/site/directory
```

 3.Create a file:

```
nano phpinfo.php
```

4. Add content to the file:

```
<?phpphpinfo();phpinfo(INFO_MODULES);?>
```

5.  Click Ctrl+x to close nano.

Press Y to save changes and Enter to confirm.

6\. Enter in the browser address bar http://your.domain.name/phpinfo.php

Here you will see information about PHP settings.

### **Installing modules (for example imagick)**

1.  Most of the names of packages start with php. If you do not know the full exact name of the required package (or are not sure), you can find it by part of the name:

```
apt-cache search package_name
```

For example, if you want to find package imagick:

```
apt-cache search php-ima
```

As a result, you will be presented with a list of all packages whose names include "ima", and a description of these packages:

- php-image-text – Image\_Text – Advanced test maipulations in images
- php-imahick – Privides a wropper to the ImageMahick library
- php-imap – IMAP module for PHP \[default\]
- php7.2-imap – IMAP module for PHP

From this list, we need php-imagick.

2. Update information from repositories:

```
Apt update
```

3. Install the library:

```
apt install php-imagick
```

Instead of "php-imagick" you can enter the name of any other package. If you know exactly the name of the package - you can skip step 1. 

4. Check your extension directory:

\- enter in the address bar of your browser http://your.domain.name/phpinfo.php,

\- find the extension\_dir parameter. The line for this parameter will display the directory for the extensions.

5\. To check if the required library is in the given category:

\- Change directory for extensions:

**cd extension\_directory**

\- Enter:

**ls library\_name**

In our case, for the imagick library, you need to enter:

**ls imagick**

Or you can specify part of the name:

**ls imag\***

If the library is in the extension directory, it will be displayed in the console.

6. Check the directory for additional config files:

\- enter in the address bar of your browser http://your.domain.name/phpinfo.php,

\- find the **Scan this dir for additional.ini files** parameter, in the line of this parameter the directory for additional configuration files will be displayed,

\- go to this directory:

```
cd directory_address
```

\- browse the contents of the directory:

```
ls file_name
```

In our case, for imagick you need to enter:

```
ls imagick
```

Or you can specify part of the name:

```
ls imag*
```

If a configuration file with a directive connecting the library has been created, then the console will display:

```
root@name:directory_address ls imagick 20-imagick.ini
```

7\. Create config file if missing:

```
echo "extension=imagick.so" > / directory_from_item_6/imagick.ini
```

It will create an imagick.ini configuration file in the required directory and add the extension = imagick.so directive to it.

When this command is executed, a configuration file “imagick.ini” will be created in the specified directory, and the necessary directive “extension = imagick.so.” will be added to this file.

8. Restart Apache:

```
service apache2 restart
```

9. Refresh the page in the browser http://your.domain.name/phpinfo.php.

To check the installation was successful, find the required module on the page.

#### **Connecting external libraries**

You can also link libraries from other sources (not from the repository).

1\.  Upload the library file (with the .so extension) to the extension directory.

To find out the address of the directory, enter in the address bar of the browser http://your.domain.name/phpinfo.php.

Find the extension\_dir parameter, in the line of this parameter the directory for extensions will be displayed.

2\. Go to the directory with additional configuration files.

To find out the address of the directory, enter http: //your.domainname/phpinfo.php in the address bar of your browser. Find the Scan this dir for additional.ini files parameter, the line for this parameter will display the directory for additional configuration files.

Change to this directory:

```
cd directory_address
```

3\.Create a config file:

```
nano library_name.ini
```

4. Specify a directive in this file, save the changes:

```
extension=library_name.so
```

5\.Restart the Apache web server:

```
service apache2 restart
```

6\.Refresh the page http: //your.domain.name/phpinfo.php in your browser and check for the name of the installed library there.

If an error occurs and the library file is located in a different directory, at step 4 in the directive, additionally specify the required path:

extension=path\_to\_library/library\_name.so

 

If you have any questions, please create a [**ticket to technical support**](https://ishosting.com/en/support).

- [Virtual Private Servers](https://help.ishosting.com/en/virtual-private-servers#main-content)

    - [Getting Started](https://help.ishosting.com/en/virtual-private-servers#getting-started)
    - [Working with VPS](https://help.ishosting.com/en/virtual-private-servers#working-with-vps)
    - [Software](https://help.ishosting.com/en/virtual-private-servers#software)
    - [Backup and Data Storage](https://help.ishosting.com/en/virtual-private-servers#backup-and-data-storage)
    - [Additional Services](https://help.ishosting.com/en/virtual-private-servers#additional-services)
    - [VPS Load](https://help.ishosting.com/en/virtual-private-servers#vps-load)
    - [Other Issues](https://help.ishosting.com/en/virtual-private-servers#other-issues)
- [Dedicated Servers](https://help.ishosting.com/en/dedicated-servers#main-content)

    - [Getting Started](https://help.ishosting.com/en/dedicated-servers#getting-started)
    - [Working with Dedicated Server](https://help.ishosting.com/en/dedicated-servers#working-with-dedicated-server)
    - [Additional Services](https://help.ishosting.com/en/dedicated-servers#additional-services)
    - [Other Issues](https://help.ishosting.com/en/dedicated-servers#other-issues)
- [Server Administration](https://help.ishosting.com/en/server-administration#main-content)

    - [API](https://help.ishosting.com/en/server-administration#api)
    - [Windows Instructions](https://help.ishosting.com/en/server-administration#windows-instructions)
    - [UNIX Instructions](https://help.ishosting.com/en/server-administration#unix-instructions)
    - [ispmanager](https://help.ishosting.com/en/server-administration#ispmanager)
    - [VestaCP](https://help.ishosting.com/en/server-administration#vestacp)
    - [DirectAdmin](https://help.ishosting.com/en/server-administration#directadmin)
    - [BitrixVM](https://help.ishosting.com/en/server-administration#bitrixvm)
    - [Security](https://help.ishosting.com/en/server-administration#security)
    - [DDoS Protection](https://help.ishosting.com/en/server-administration#ddos-protection)
    - [Working with Files](https://help.ishosting.com/en/server-administration#working-with-files)
    - [Databases](https://help.ishosting.com/en/server-administration#databases)
    - [PHP](https://help.ishosting.com/en/server-administration#php)
    - [Logs and Statistics](https://help.ishosting.com/en/server-administration#logs-and-statistics)
    - [Diagnostics and Troubleshooting](https://help.ishosting.com/en/server-administration#diagnostics-and-troubleshooting)
    - [HestiaCP](https://help.ishosting.com/en/server-administration#hestiacp)
    - [cPanel](https://help.ishosting.com/en/server-administration#cpanel)
    - [aaPanel](https://help.ishosting.com/en/server-administration#aapanel)
    - [FastPanel](https://help.ishosting.com/en/server-administration#fastpanel)
    - [Other](https://help.ishosting.com/en/server-administration#other)
- [Mail](https://help.ishosting.com/en/mail#main-content)

    - [Getting Started](https://help.ishosting.com/en/mail#getting-started)
    - [ispmanager](https://help.ishosting.com/en/mail#ispmanager)
    - [DirectAdmin](https://help.ishosting.com/en/mail#directadmin)
    - [VestaCP](https://help.ishosting.com/en/mail#vestacp)
    - [Other Issues](https://help.ishosting.com/en/mail#other-issues)
- [VPN](https://help.ishosting.com/en/vpn#main-content)

    - [Getting Started](https://help.ishosting.com/en/vpn#getting-started)
    - [Android](https://help.ishosting.com/en/vpn#android)
    - [iOS](https://help.ishosting.com/en/vpn#ios)
    - [macOS](https://help.ishosting.com/en/vpn#macos)
    - [Mikrotik](https://help.ishosting.com/en/vpn#mikrotik)
    - [Linux](https://help.ishosting.com/en/vpn#linux)
    - [Windows](https://help.ishosting.com/en/vpn#windows)
    - [Amnezia VPN](https://help.ishosting.com/en/vpn#amnezia-vpn)
    - [Hysteria](https://help.ishosting.com/en/vpn#hysteria)
- [Data Storage](https://help.ishosting.com/en/data-storage#main-content)

    - [Getting Started](https://help.ishosting.com/en/data-storage#getting-started)
    - [Backups](https://help.ishosting.com/en/data-storage#backups)
    - [Other](https://help.ishosting.com/en/data-storage#other)
- [SSL Certificates](https://help.ishosting.com/en/ssl-certificates#main-content)

    - [Getting Started](https://help.ishosting.com/en/ssl-certificates#getting-started)
    - [Install](https://help.ishosting.com/en/ssl-certificates#install)
- [Affiliate Program](https://help.ishosting.com/en/affiliate-program)
- [Additional Services](https://help.ishosting.com/en/additional-services#main-content)

    - [Additional IP](https://help.ishosting.com/en/additional-services#additional-ip)
    - [Control Panels](https://help.ishosting.com/en/additional-services#control-panels)
    - [Antivirus](https://help.ishosting.com/en/additional-services#antivirus)
- [Client Area](https://help.ishosting.com/en/client-area#main-content)

    - [Balance History](https://help.ishosting.com/en/client-area#balance-history)
- [Payment for Services](https://help.ishosting.com/en/payment-for-services#main-content)

    - [Getting Started](https://help.ishosting.com/en/payment-for-services#getting-started)
    - [My Account](https://help.ishosting.com/en/payment-for-services#my-account)
    - [Payments](https://help.ishosting.com/en/payment-for-services#payments)
    - [Other Issues](https://help.ishosting.com/en/payment-for-services#other-issues)
- [Documents and Policies](https://help.ishosting.com/en/documents-and-policies#main-content)

    - [General](https://help.ishosting.com/en/documents-and-policies#general)
    - [Company](https://help.ishosting.com/en/documents-and-policies#company)
- [Questions and Answers](https://help.ishosting.com/en/questions-and-answers#main-content)

    - [Control Panels](https://help.ishosting.com/en/questions-and-answers#control-panels)
    - [ispmanager](https://help.ishosting.com/en/questions-and-answers#ispmanager)
    - [Windows](https://help.ishosting.com/en/questions-and-answers#windows)
    - [Linux](https://help.ishosting.com/en/questions-and-answers#linux)
    - [Mail](https://help.ishosting.com/en/questions-and-answers#mail)
    - [Other](https://help.ishosting.com/en/questions-and-answers#other)
- [Special Offers](https://help.ishosting.com/en/special-offers)
- [is\*smart](https://help.ishosting.com/en/issmart#main-content)

    - [General Info](https://help.ishosting.com/en/issmart#general-info)
    - [Getting Started](https://help.ishosting.com/en/issmart#getting-started)
    - [API](https://help.ishosting.com/en/issmart#api)
    - [AI Models](https://help.ishosting.com/en/issmart#ai-models)
- [List of Apps](https://help.ishosting.com/en/list-of-apps)

[![is\*hosting](https://help.ishosting.com/hubfs/ishosting-logo-black.svg "is*hosting")](https://ishosting.com)

<https://www.facebook.com/ishostingcom> <https://twitter.com/ishostingcom> <https://www.instagram.com/is.hosting> <https://www.youtube.com/@ishosting> <https://www.linkedin.com/company/is-hosting>

Copyright © 2025, © Webrain OÜ