I'm running PHP7.4 on CentOS7 and am having trouble getting the zip module to show up when I run php -m
I tried installing php-zip and php-pecl-zip through yum, which gives me the following result:
Resolving Dependencies
--> Running transaction check
---> Package php72w-common.x86_64 0:7.2.34-1.w7 will be installed
Removing php72w-common.x86_64 0:7.2.34-1.w7 - u due to obsoletes from installed php-common-7.4.21-1.el7.remi.x86_64
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package php72w-common.x86_64 0:7.2.34-1.w7 will be installed
--> Finished Dependency Resolution
Does this mean the zip module is already installed by default onto PHP7.4? Is there a reason I can't get it to activate?
I also added 40-zip.ini as per another Stackoverflow answer under /etc/php.d/
but no dice. I've also restarted my apache webserver (systemctl restart httpd
).
Can someone tell me what the message means and what I can do to install ZipArchive onto my server? Any help would be appreciated, thanks!
My Answer:
> Package php-pecl-zip.x86_64 0:1.19.0-1.el7.remi.7.4 will be installed
> Package php-zip.x86_64 0:7.4.16-1.el7.remi will be installed
__However, when I run php -m, the zip module is still not showing up. How can I get the ZipArchive module installed and enabled on PHP7.4?__
To enable the ZipArchive module on PHP7.4, you may need to manually enable it in your PHP configuration file. Here's how you can do it:
1. Locate your PHP configuration file. This is typically located in /etc/php.ini or /etc/php/7.4/cli/php.ini.
2. Open the PHP configuration file in a text editor.
3. Search for the following line in the file:
;extension=zip
4. Uncomment the line by removing the semicolon at the beginning:
extension=zip
5. Save the file and restart your web server or PHP-FPM service for the changes to take effect.
6. After restarting, run `php -m` again to check if the ZipArchive module is now enabled.
If the above steps do not work, you can also try installing the zip module using PECL:
1. Install the necessary development tools and libraries:
sudo yum install gcc make re2c libzip-devel
2. Install the zip module using PECL:
sudo pecl install zip
3. Add the following line to your PHP configuration file to enable the zip module:
extension=zip.so
4. Save the file and restart your web server or PHP-FPM service.
5. Run `php -m` to check if the ZipArchive module is now enabled.
By following these steps, you should be able to install and enable the ZipArchive module on PHP7.4.
Rate this post
4 of 5 based on 5191 votesComments