php class ziparchive not found

ZipArchive not found but appears to be installed (PHP 7.2)

I’m installing a CMS that requires ZipArchive on an Amazon EC2 instance (Amazon Linux 2). The requirements wizard says ZipArchive is not supported:

php class ziparchive not found. Смотреть фото php class ziparchive not found. Смотреть картинку php class ziparchive not found. Картинка про php class ziparchive not found. Фото php class ziparchive not found

But if I try to install ZipArchive as per instructions I’ve found online, the server tells me it’s already installed:

I have restarted the httpd service.

I have also tried adding:

To php.ini and restarted the httpd service. Still no joy.

Almost a day trying to work this out and I’m at a loss as to where to go from here. Can somebody point me in the right direction?

3 Answers 3

If you are using Remi’s repo, I noticed the zip module is a pecl extension, so to install and enable zip run

Then restart php-fpm is you are using NGINX or restart APACHE

You can install Remi repo

I had the same problem (Amazon Linux 2 AMI) trying to install Laravel. The problem is that this AMI uses libzip 0.10.1 while at least 0.11 is required, and if you check in your extension folder (in this AMI: /usr/lib64/php/modules), the file zip.so is missing. So, if you enable the extension in your php.ini file, you’ll get an error in apache’s log. I solved the issue using Remi’s RPM repository to install libzip 1.1.3. This is what I did:

install libzip from the repo. You can check the new libzip version, ie:

Now that you have a compatible libzip, you can compile the zip extension: download the package from PECL in your tmp folder, extract the files and from the package root:

after the make install command, the output should be:

and if you go in that dir, now you should finally see the zip.so file.

Change your php.ini adding

Restart webserver and check your php info. This is what I see in mine:

Источник

Class ‘ZipArchive’ not found in PHPExcel/Reader/Excel2007.php on line 86 #1130

Comments

shaheenhashinclude commented Feb 13, 2017

I got an error
Message: Class ‘ZipArchive’ not found
Filename: Reader/Excel2007.php
Line Number: 86

The text was updated successfully, but these errors were encountered:

We are unable to convert the task to an issue at this time. Please try again.

The issue was successfully created but we are unable to update the comment at this time.

PowerKiKi commented Feb 14, 2017

Upgrade to PHPExcel 1.8.1. In that latest version, there is nothing on line 86. So you should not experience that bug if you had latest version.

shaheenhashinclude commented Feb 14, 2017 •

Hi
I am attached PHPExcel/Reader/Excel2007.php
Excel2007.zip

same error occurs
Message: Class ‘ZipArchive’ not found

This file is working on localhost(php version 7.0). And not working in server(php version 5.4.45)

PowerKiKi commented Feb 14, 2017

shaheenhashinclude commented Feb 14, 2017

PowerKiKi commented Feb 14, 2017

This might be solved by installing the extension, or using an alternative implementation via:

shaheenhashinclude commented Feb 15, 2017

var_dump(extension_loaded (‘zip’)) returns bool(false)
where to place this code PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);

PowerKiKi commented Feb 15, 2017

This should be the first thing before using PHPExcel. Eg:

shaheenhashinclude commented Feb 17, 2017 •

I am using linke this
PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);

PowerKiKi commented Feb 17, 2017

this is a warning, not an error. You can’t do much about it now, unless migrate to unstable 1.8 branch (not recommended), or migrate to PhpSpreadsheet (only if you understand the risks).

ghost commented Jul 18, 2017

I have faced the same issue but i got fixed

Step1:
sudo apt-get install php5.6-zip

Step 2:
sudo service apache2 restart

cdmathukiya commented Jul 31, 2017

you just need to add zip module in server from cpanel
you can set it from here

Источник

Неустранимая ошибка: класс «ZipArchive» не найден в

У меня проблема с установкой «Archive_Zip 0.1.1» на сервере Linux, но когда я пытаюсь запустить скрипт для создания zip-файла, он дает фатальную ошибку « Неустранимая ошибка: класс« ZipArchive »не найден в — » где я помещаю код

но он не нашел файл класса.

Скажите, пожалуйста, решение, что я должен сделать, чтобы решить проблему. Я также помещал файл php.ini в папку, где есть скрипт, но он не работает.

См. Эту страницу для инструкций по установке (как для Linux, так и для Windows).

На Amazon ec2 с Ubuntu + nginx + php7 у меня были те же проблемы, которые были решены с помощью:

sudo apt-get install php7.0-zip

На рабочем столе ubuntu я должен был это сделать.

Это установило библиотеку, но я все равно продолжал получать ту же ошибку, поэтому мне пришлось перезапустить apache, используя:

Я не вижу его здесь, поэтому я хотел бы добавить, что на Debian / Ubuntu вам может потребоваться включить расширение после установки относительного пакета. Так:

Вам также необходимо скомпилировать PHP с поддержкой zip. В руководстве говорится следующее:

Чтобы использовать эти функции, вы должны скомпилировать PHP с поддержкой zip, используя опцию –enable-zip configure.

Недостаточно просто установить правильные расширения на сервере. Взгляните на ссылку по установке Pekka, опубликованную ранее. Мой ответ – просто разъяснение его.

PHP 5.2.0 и более поздние версии

Чтобы использовать эти функции, вы должны скомпилировать PHP с поддержкой zip, используя опцию –enable-zip configure.

Пользователям Windows необходимо включить php_zip.dll внутри php.ini, чтобы использовать эти функции.

и не нужно перезапускать php7.0-fpm вручную.

Прежде всего, решение для удаленного сервера:

Вы должны видеть, как изображение. php class ziparchive not found. Смотреть фото php class ziparchive not found. Смотреть картинку php class ziparchive not found. Картинка про php class ziparchive not found. Фото php class ziparchive not found

Обновить страницу. Ошибка должна исчезнуть.

Примечание. Если вы не нашли, обратитесь к поставщику услуг. Они установят для вас.

2) Или используйте метод __autoload класса. В PHP 5 это приветливый метод __autoload ().

Источник

Fatal error: Class ‘ZipArchive’ not found in

I have a problem that I install ‘Archive_Zip 0.1.1’ on Linux server, but when I try to run the script to create the zip file it gives the fatal error

where I put the code

but it doesn’t find the class file.

Please tell me the solution. What should I do to resolve the problem? I also put php.ini file to the folder where script is, but it does not work.

23 Answers 23

For the ZipArchive class to be present, PHP needs to have the zip extension installed.

See this page for installation instructions (both Linux and Windows).

php class ziparchive not found. Смотреть фото php class ziparchive not found. Смотреть картинку php class ziparchive not found. Картинка про php class ziparchive not found. Фото php class ziparchive not found

php class ziparchive not found. Смотреть фото php class ziparchive not found. Смотреть картинку php class ziparchive not found. Картинка про php class ziparchive not found. Фото php class ziparchive not found

On Amazon ec2 with Ubuntu + nginx + php7, I had the same issues, solved it using:

sudo apt-get install php7.0-zip

php class ziparchive not found. Смотреть фото php class ziparchive not found. Смотреть картинку php class ziparchive not found. Картинка про php class ziparchive not found. Фото php class ziparchive not found

On ubuntu desktop, I had to do.

This installed the library but I still kept on getting the same error, so I had to restart apache using:

I’m not seeing it here, so I’d like to add that on Debian/Ubuntu you may need to enable the extension after installing the relative package. So:

First of all, The solution for remote server:

If you are using cpanel you may have zip extension installed but not activate. You need to active it. For this case you need to go to cpanel > inside software section > click on PHP version. Then find zip and check it. Now save.

You should see like the image. php class ziparchive not found. Смотреть фото php class ziparchive not found. Смотреть картинку php class ziparchive not found. Картинка про php class ziparchive not found. Фото php class ziparchive not found

Refresh page. The error should disappear.

Note: If you dont found, contact server provider. They will install for you.

php class ziparchive not found. Смотреть фото php class ziparchive not found. Смотреть картинку php class ziparchive not found. Картинка про php class ziparchive not found. Фото php class ziparchive not found

Centos 6

Or any RHEL-based flavors

php class ziparchive not found. Смотреть фото php class ziparchive not found. Смотреть картинку php class ziparchive not found. Картинка про php class ziparchive not found. Фото php class ziparchive not found

If you have WHM available it is easier.

Log in to WHM.

Go to EasyApache 4 (or whatever version u have) under Software tab.

Under Currently Installed Packages click Customize.

Go to PHP Extensions, in search type «zip» (without quotes),

you should see 3 modules

click blue button few times to finish the process.

This worked for me. Thankfully I’ve WHM available.

You also need to compile PHP with zip support. The manual says the following:

It’s not enough to simply install the correct extensions on the server. Have a look at the installation instructions link Pekka posted earlier. My answer is just a clarification of his.

and no need to restart php7.0-fpm manually.

Creating config file /etc/php/7.0/mods-available/zip.ini with new version
Processing triggers for php7.0-fpm ( 7.0.11-1+deb.sury.org

Источник

PHPExcel ZipArchive не найден

No releases availble for package «pecl.php.net/zip» Cannot initialize ‘channel://pecl.php.net/zip’, invalid or missing package file Package «channel://pecl.php.net/zip» is not valid install failed

и pear install zip-1.10.2.tgz но получил почти то же самое сообщение.

у меня нет разрешения root на сервер, может быть, это так? В любом случае, ты можешь мне помочь?

5 ответов

некоторые форматы файлов электронных таблиц, такие как OfficeOpenXML, используемые по умолчанию Excel 2007 и выше, требуют ZipArchive. В самых последних версиях PHP ZipArchive всегда доступен, но до PHP 5.3 его необходимо было вручную установить как расширение PHP.

как @briosheje говорит, Если у вас нет ZipArchive установлен / включен для вашего PHP, то вы можете использовать

PCLZip включен в дистрибутив PHPExcel в качестве альтернативы PHP встроенный класс ZipArchive, хотя и довольно медленный. Включение PCLZip позволяет работать с форматами электронных таблиц на основе zip даже без ZipArchive.

однако, когда мы впервые связали PCLZip (первоначально в PHPExcel 1.7.6), это был только вариант при написании форматов на основе zip, а не при их чтении. Мы изменили это в PHPExcel 1.8.0, поэтому включение PCLZip теперь позволяет читать форматы на основе zip, а также писать их.

детали документации читателя PHPEXcel различные форматы электронных таблиц, и объясняет, какие из них на основе zip.

в моем случае у меня есть PHP 5.4
При использовании PHPExcel я столкнулся с этим исключением.

решил это, добавив эту строку на PHPExcel / Reader / Excel2007.в PHP

перед вызовом метода getZipClass.

вы должны установить расширение для php под названием Like php-zip и zip-программа на вашем компьютере linux.

Если вы используете cpanel, вы можете установить расширение zip, но не активировать. Вам нужно его активировать. Для этого вам нужно перейти в cpanel > внутри раздела программного обеспечения > нажмите на версию PHP. Затем найдите zip и проверьте его. Теперь спасай. php class ziparchive not found. Смотреть фото php class ziparchive not found. Смотреть картинку php class ziparchive not found. Картинка про php class ziparchive not found. Фото php class ziparchive not found

обновите страницу приложения.

Я нашел простое решение

теперь вы обновите свой сайт, чтобы загрузить файл excel

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *