Difference between revisions of "admin/environment/php extension/zip"

Jump to: navigation, search
(New page: The Zip PHP extension is required by Moodle, info-ZIP binaries or PclZip library are not used anymore. This extension enables you to transparently read or write ZIP compressed archives and...)
 
m (Added link to spanish translation of page)
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The Zip PHP extension is required by Moodle, info-ZIP binaries or PclZip library are not used anymore.
+
{{Environment}}
This extension enables you to transparently read or write ZIP compressed archives and the files inside them.  
+
The native PHP zip extension is required to let Moodle 2 read or write ZIP compressed archives.
  
 +
Native installations of php will need php zip library enabling by adding the line
  
[[Installation]]
+
extension=zip.so
For the Zip file functions to work on your server, these libraries must be installed:
 
  
•The ZZIPlib library by Guido Draheim: Download the ZZIPlib library
+
to php.ini
•The Zip PELC extension: Download the Zip PELC extension
 
  
[[Installation on Linux Systems]]
+
However if your php was not compiled with the extension then...
  
PHP 5+: Zip functions and the Zip library is not enabled by default and must be downloaded from the links above. Use the --with-zip=DIR configure option to include Zip support.
+
'''Installation on Linux Systems'''
  
[[Installation on Windows Systems]]
+
If your distribution doesn't include this extension by default, then you need to compile PHP yourself and include --enable-zip.
  
PHP 5+: Zip functions is not enabled by default, so the php_zip.dll and the ZZIPlib library must be downloaded from the link above. php_zip.dll must be enabled inside of php.ini.
+
This general PHP configuration will work well with Moodle 2.0:
  
To enable any PHP extension, the PHP extension_dir setting (in the php.ini file) should be set to the directory where the PHP extensions are located. An example extension_dir value is c:\php\ext.
+
./configure  --with-apxs2=/usr/sbin/apxs --enable-mbstring --with-mysql=/usr --with-pear --enable-sockets
 +
              --with-gd --with-jpeg-dir=/usr --with-ttf --with-freetype-dir=/usr --with-zlib-dir=/usr
 +
              --with-iconv --with-curl --with-openssl --with-mysqli --enable-soap --with-xmlrpc --enable-zip
 +
 
 +
'''Installation on Windows Systems'''
 +
 
 +
Uncomment this line in your php.ini:
 +
 
 +
  extension=php_zip.dll
 +
 
 +
Note: The Zip extension is built-in since PHP 5.3.x on Windows. The above php.ini line and the corresponding dll file is not required if using the distribution from windows.php.net. Not verified on other distributions on other OSs.
 +
 
 +
[[Category:Environment|php extension]]
 +
 
 +
[[es:admin/environment/php extension/zip]]

Latest revision as of 16:12, 22 January 2014

The native PHP zip extension is required to let Moodle 2 read or write ZIP compressed archives.

Native installations of php will need php zip library enabling by adding the line

extension=zip.so

to php.ini

However if your php was not compiled with the extension then...

Installation on Linux Systems

If your distribution doesn't include this extension by default, then you need to compile PHP yourself and include --enable-zip.

This general PHP configuration will work well with Moodle 2.0:

./configure  --with-apxs2=/usr/sbin/apxs --enable-mbstring --with-mysql=/usr --with-pear --enable-sockets 
             --with-gd --with-jpeg-dir=/usr --with-ttf --with-freetype-dir=/usr --with-zlib-dir=/usr 
             --with-iconv --with-curl --with-openssl --with-mysqli --enable-soap --with-xmlrpc --enable-zip

Installation on Windows Systems

Uncomment this line in your php.ini:

 extension=php_zip.dll

Note: The Zip extension is built-in since PHP 5.3.x on Windows. The above php.ini line and the corresponding dll file is not required if using the distribution from windows.php.net. Not verified on other distributions on other OSs.