If you really have the ZIP extension available on the server, you can use dl() to dynamically load (<5.3).
if (!extension_loaded('zip')) { // Attempt to load the zip $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; dl($prefix . 'zip.' . PHP_SHLIB_SUFFIX); if (!extension_loaded('zip')) { // Couldn't load the ZIP module dynamically, either return false; } }
If you use version higher than 5.3.0, you will not be able to use dl if it is not running on the command line or built into the web server.
This leaves your only option for modifying php.ini if you cannot recompile the module built into PHP. You cannot do this with ini_set , since it will only be applied at runtime, while all necessary modules will already be loaded by the PHP executable at startup.
Rudi visser
source share