Phpexcel when the site migrated to the Linux platform, the error Class ' ziparchive ' not found
reason: Because PHP does not have a ZIP module installed
Workaround: Install the Zip module
resolution Process:
Get to Zip package
wget Http://pecl.php.net/get/zip
unzip the zip package and enter
TAR-ZXVF ZIPCD zip-1.x.x
This is a command that can be installed by yum install
php-devel and then execute phpize if the hint is not available.
Phpize
At this point you need to get to the location of the native Php-config, the method is very simplePHP Installation information can be obtained via the
phpinfo () functioncan also
Find/-name php-config
you may find several, but according to your own installation situation to find the corresponding directory, after the simple compilation, installation. Note: Configure does not add parameters, you will get a path after executing make insatall, there is a generated zip.so
./configure--with-php-config=/usr/local/php5/bin/php/php-config
Compile(I use root permissions, not root privileges to switch attention)
Make
Installation(I use root permissions, not root privileges to switch attention)
Make instal
Find your php.ini file locationalso available through
Find/-name php.ini You can also get the php.ini position by
phpinfo ();
make three changes to the Extension_dir directory to your file-generated directory, note that if it has been developed, it is recommended to copy the zip.so to the established directorySet extension=zip.so
Extension_dir =/usr/local/lib/php/extensions/extension=zip.so
set the following parameters, you can find the parameter to see if it is turned on, set the value on after opening
Zlib.output_compression = On
This has been configured to restart Apache by command
Service Apache2 Restart
you can then write the <?php echo phpinfo () in the PHP file;
?> Access the file, view the current configuration information, see if the ZIP module is installed successfully, the whole installation process is so, the most error-prone place is compile (make) so be careful to configure the parameters when executing configure, Now that your PHP Zip module has been installed successfully, test the following Excel export for problems.