Fatal error: Class 'ZipArchive' not found in

后端 未结 20 1311
既然无缘
既然无缘 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:41

    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.

    Refresh page. The error should disappear.

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

    0 讨论(0)
  • 2020-11-27 03:42

    On ubuntu desktop, I had to do.

    sudo apt-get install php5.6-zip
    

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

    sudo service apache2 restart
    

    and it worked.

    0 讨论(0)
  • 2020-11-27 03:43

    I faced this issue on GCP while deploying wordpress in the App Engine Standard environment. This solved it :

    sudo apt-get install php7.2-zip
    
    0 讨论(0)
  • 2020-11-27 03:43

    Try to write \ZIPARCHIVE instead of ZIPARCHIVE.

    0 讨论(0)
  • 2020-11-27 03:45

    This worked

    apt-get install php7.0-zip
    

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

    Unpacking php7.0-zip (7.0.16-4+deb.sury.org~trusty+1) ...
    Processing triggers for php7.0-fpm (7.0.11-1+deb.sury.org~trusty+1) ...
    php7.0-fpm stop/waiting
    php7.0-fpm start/running, process 1572
    php7.0-fpm stop/waiting
    php7.0-fpm start/running, process 1777
    Setting up php7.0-zip (7.0.16-4+deb.sury.org~trusty+1) ...
    locale: Cannot set LC_ALL to default locale: No such file or directory

    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~trusty+1) ...
    php7.0-fpm stop/waiting
    php7.0-fpm start/running, process 2354
    php7.0-fpm stop/waiting
    php7.0-fpm start/running, process 2397

    0 讨论(0)
  • 2020-11-27 03:47

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

    In order to use these functions you must compile PHP with zip support by using the --enable-zip configure option.

    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.

    0 讨论(0)
提交回复
热议问题