Search code examples
phpapachephp-ziparchivephp-7.4virtualmin

How can I install ziparchive on php 7.4?


I am running Virtuamin on centos 7, I am unable to install ziparchive on php 7.4, but when I switch to php 7.2, it works. I need php 7.4 to work because it is faster and wordpress script need 7.3+ to work effectively.


Solution

  • I am on Debian 9, which does not ship with PHP7.4, but it can be installed if you add the repository from Sury.

    sudo apt install ca-certificates apt-transport-https
    wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add -
    echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list
    

    After that, I ran this with success:

    apt install php7.4-zip
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
      php7.4-zip
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 20.5 kB of archives.
    After this operation, 94.2 kB of additional disk space will be used.
    Get:1 https://packages.sury.org/php stretch/main amd64 php7.4-zip amd64 7.4.7-1+                                                                           0~20200612.18+debian9~1.gbp671911 [20.5 kB]
    Fetched 20.5 kB in 0s (149 kB/s)
    Selecting previously unselected package php7.4-zip.
    (Reading database ... 107553 files and directories currently installed.)
    Preparing to unpack .../php7.4-zip_7.4.7-1+0~20200612.18+debian9~1.gbp671911_amd                                                                           64.deb ...
    Unpacking php7.4-zip (7.4.7-1+0~20200612.18+debian9~1.gbp671911) ...
    Processing triggers for libapache2-mod-php7.4 (7.4.7-1+0~20200612.18+debian9~1.g                                                                           bp671911) ...
    Setting up php7.4-zip (7.4.7-1+0~20200612.18+debian9~1.gbp671911) ...
    Creating config file /etc/php/7.4/mods-available/zip.ini with new version
    Processing triggers for php7.4-fpm (7.4.7-1+0~20200612.18+debian9~1.gbp671911) .                                                                           ..
    NOTICE: Not enabling PHP 7.4 FPM by default.
    NOTICE: To enable PHP 7.4 FPM in Apache2 do:
    NOTICE: a2enmod proxy_fcgi setenvif
    NOTICE: a2enconf php7.4-fpm
    NOTICE: You are seeing this message because you have apache2 package installed.
    Processing triggers for libapache2-mod-php7.4 (7.4.7-1+0~20200612.18+debian9~1.g                                                                           bp671911) ...
    Processing triggers for php7.4-cgi (7.4.7-1+0~20200612.18+debian9~1.gbp671911) .                                                                           ..
    Processing triggers for php7.4-cli (7.4.7-1+0~20200612.18+debian9~1.gbp671911) .                                                                           ..