(Class & amp; #39; ZipArchive & amp; #39; notfound) Add the zip module to linuxapache

Source: Internet
Author: User

(Class & #39; ZipArchive & #39; notfound) Add the zip module to linuxapache
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-config compilation (I use the root permission, but not the root permission. Please switch it)
Make installation (I am using the root permission, but not the root permission. Please switch)
Make instal to find the location of your php. ini file.Find/-name php. iniYou can also usePhpinfo ();Get php. make three changes to the ini location and direct the extension_dir directory to the directory generated by your file. Note that if this is already done, we recommend that you zip it. so copy 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 the configuration is complete. Run the command to restart apache.
Service apache2 restart can be written to the PHP file <? 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.

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.