skip to Main Content

I have downloaded zip extension for PHP 7.3 on CentOS by typing the following command

yum install php73-php-pecl-zip

and added extension=zip.so to php.ini file, also restarted httpd service.

Still cannot see zip extension in phpinfo() and in my code I still get Class 'ZipArchive' not found in... error.

What should I do?

2

Answers


  1. Chosen as BEST ANSWER

    I ran following command to find out where the package installed

    rpm -ql php73-php-pecl-zip
    

    as a result of that I could see the directory where the so file installed.

    /opt/remi/php73/root/usr/lib64/php/modules/zip.so
    

    I copied zip.so to default extension directory

    cp /opt/remi/php73/root/usr/lib64/php/modules/zip.so /usr/lib64/php/modules/zip.so
    

    And finally restarted httpd server.

    Thanks to @Anders who gave me that idea


  2. I copied zip.so to default extension directory

    No.

    If you use base package (php-*) you need php-pecl-zip.

    php73-php-pecl-zip is a SCL package designed for parallel installation.

    See the repository FAQ

    For a proper configuration, and to avoid such issues, follow the Wizard instructions.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search