Fatal error: Class 'ZipArchive' not found in

后端 未结 20 1431
既然无缘
既然无缘 2020-11-27 03:39

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

<
20条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 03:48

    I had the same issue with CentOS and cPanel installed server. I installed zipArchive package via cPanel and didn't worked as expected. After trying with so many fixes suggested each and everywhere just the below worked for me.

    First find the name for the correct package with the below command

    yum search zip |grep -i php
    

    Then use the below code.

    yum install your_zip_package_name_with_php_version
    

    In my case correct code to install zipArchive was

    yum install php-pecl-zip.x86_64
    

    I had the solution from this link. How can I inslatt zipArchive on PHP 7.2 with CentOS 7?

    And this installation somehow enabled that package too and it also restarted the effecting services and after the completion of the execution of the above code zipArchive issue was gone.

提交回复
热议问题