(Class 'ziparchive 'not found) linux apache adds the zip module and ziparchiveapache
When the website is exported to phpexcel on the linux platform, the error "Class 'ziparchive 'not found" is displayed.
Cause: php does not have the zip module installed.
Solution: Install the zip module.
Get zip package
Decompress the zip package and enter
tar -zxvf zipcd zip-1.x.x
This is a command.
Yum install php-devel
And then run phpize.
In this case, you need to obtain the php-config location of the local machine. The method is also very simple.
The function can obtain the php installation information.
You may find several, but find the corresponding directory based on your own installation, and then compile and install it easily. NOTE: If configure is not added with parameters, an error will occur. After you execute make insatall, you will get a path containing the generated zip. so.
Compile (I use the root permission, but not the root permission. Please switch)
Installation (I use the root permission, but not the root permission. Note the switch)
You can find the location of your php. ini file through
Find/-name php. ini
You can also use
Obtain the location of php. ini.
Make three modifications to direct the extension_dir directory to the directory generated by your file. Note that if this is already done, we recommend that you copy zip. so to the specified directory and set extension = zip. so.
extension_dir = /usr/local/lib/php/extensions/extension=zip.so
Set the following parameters. You can first find the parameter to see if it has been enabled, and then set the value to On
zlib.output_compression = On
Now that the configuration is complete, run the command to restart apache.
service apache2 restart
Then, you can write <? Php echo phpinfo ();
?> Access this file, view the current configuration information, and check whether the zip module has been installed successfully. The entire installation process is like this. The most error-prone part is make) so be sure to configure the parameters when you execute configure. So far, the zip module in your php has been installed successfully. Check whether the following excel export problems exist.
PHP: Class 'ziparchive 'not found in
Remove the semicolon before extension = php_zip.dll in php. ini. The premise is that you have installed php_zip.dll In the ext folder in php.
Linux, Class 'mysqli' not found