Unable to Use ZIP Extension - PHP 8.0

Context
I have Mautic installed on a website through cyber panel hosted on hostinger.

I am attempting to update mautic but it gets stuck on Extracting Package:

All sources online confirmed this is due to not having a php zip extension installed/enabled.

Note: Mautic requires a minimum PHP 7.4. I am using PHP 8.0

Problem
I have attempted the following instructions to use PEAR package manager to install extensions not available in the cyber panel dashboard.

When I attempted to install the zip extension, I received the following error:

pecl/zip is already installed and is the same as the released version 1.21.1 install failed.

Question
Not sure why ZIP is not working on mautic? What else could be the issue?

Is the issue related to enabling the extension since its already installed?

I have been entering SSH details for the server that are available on my hosting platform dashboard.
I understand I can also create SSH credentials for my specific website through cyber panel. Is that something that could cause this issue?

Hello @aslan

What is your default php version? post your info.php if you dont mind

It’s my own opinion that no one should use php 8 in production. This is due to security reasons and unknown zero-day vulnerabilities. The version mostly used by corporations in production is php 7.4

No problem. I am using PHP 8.0.25

https://m7.treadstonelaw.ca/info.php

No zip module was installed or detected

screenshot-m7.treadstonelaw.ca-2022.11.09-23_37_27

You should have something like this


Have you tried yum install lsphp80-zip or search it yum search lsphp80-zip and install it

/usr/local/lsws/lsphp80/bin/pecl install zip

Run killall lsphp and post contents of php -m | grep zip

1 Like

I ran yum install lsphp80-zip and this was the result:

Here is the final result with the remaining commands:

The info.php file was not updated to show zip as outlined in your screenshot.

It says here you have not set zip extension in php.ini

Edit your php.ini file to enable extension:

extension=zip.so

Finally restart LSWS systemctl restart lsws

1 Like

I cannot find a php.ini file. Is there a way to generate one on cyber panel?

Follow my tutorial in compiling php 8.0/8.1:

Php 8.1 error in INSTALL PHP EXTENSIONS - Support and Discussion / General Discussion - CyberPanel Community

I was able to edit ph.ini through cyber panel. Mautic is now extracting the package and zip is working. Thank you very much! I had been trying to solve this for a while. hopefully, this thread will help someone else in similar situation. Mautic is now stuck on clearing the cache but I will open a new thread for that.

To edit php.ini, I went to cyber panel > Edit PHP Configuration > Advanced

I added extension=zip.so at the bottom of the document.

I re-ran the commands provided earlier (not sure if this was necessary though):

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.