Fatal error: Call to undefined function zip_open() in /contact.php on line 2

Fatal error: Call to undefined function zip_open() in /contact.php on line 2

 

I got the PHP error ‘Fatal error: Call to undefined function zip_open() in /contact.php on line 2’ on my website contact page and in the server logs. My server is CentOS 7 OS with PHP 5.4 installed. To fix this error you must install php-zip extension on your server.

Run the command ‘php -m | grep zip’ to check whether PHP zip extension is enabled or not.

command : #php -m | grep zip
 

Do the below steps if PHP zip extension is not installed.

1. You must log into your linux server as ‘root’ user or user with sudo privileges

2. zip extension is provided by php-common package. Check whether php-common package is installed or not.

Command to check whether php-common is installed :

# yum list installed | grep php

OR

# rpm -qa | grep php-common

3. You can install php-common package using yum if it isn’t installed.

command to install php-common :

# yum install php-common