(Class & #39; ZipArchive & #39; not found) Add a zip module to linux apache and ziparchiveapache

Source: Internet
Author: User
Tags ziparchive

(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.

Solution Process:

Get zip package

wget http://pecl.php.net/get/zip

Decompress the zip package and enter

tar -zxvf zipcd zip-1.x.x


This is a command. Yum install php-develAnd then run phpize.
phpize


In this case, you need to obtain the php-config location of the local machine. The method is also very simple. Phpinfo ()The function can obtain the php installation information. Find/-name php-config
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.
./configure --with-php-config=/usr/local/php5/bin/php/php-config


Compile (I use the root permission, but not the root permission. Please switch)
make


Installation (I use the root permission, but not the root permission. Note the switch)
make instal


You can find the location of your php. ini file through Find/-name php. iniYou can also use Phpinfo ();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

Www.cnblogs.com/..4.html
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.