New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export database with zip compression: Class 'ZipArchive' not found error #14326
Comments
|
Am getting some file not found error, like can't find the file http://localhost/phpmyadmin-test/export.php. |
|
QA_4_8 and master are both affected by this |
|
Some notes for developers when fixing this: For me, this is caused by the php zip extension not being loaded. We should handle this much more gracefully in all cases. The ZipArchive class is used in libraries/classes/ZipExtension.php, which in turn is called in several places through the code - a robust solution will gracefully handle all these instances. At least for the export interface, I thought it may be easiest to let the zip option listed in the dropdown list, but if the zip extension is not installed we should display an inline warning next to it saying the zip file type can't be used because of the missing extension. |
|
@ibennetch, Along with displaying an inline warning should we abort the export?. |
|
@rijaspk yes, we shouldn't allow the user to submit the export form until they pick a different compression method. |
|
An example file (not a zip, edit with text editor) Content<br />
<font size='1'><table class='xdebug-error xe-uncaught-exception' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Fatal error: Uncaught Error: Class 'ZipArchive' not found in /mnt/Dev/phpmyadmintest/libraries/classes/ZipExtension.php on line <i>31</i></th></tr>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Error: Class 'ZipArchive' not found in /mnt/Dev/phpmyadmintest/libraries/classes/ZipExtension.php on line <i>31</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0827</td><td bgcolor='#eeeeec' align='right'>459720</td><td bgcolor='#eeeeec'>{main}( )</td><td title='/mnt/Dev/phpmyadmintest/export.php' bgcolor='#eeeeec'>.../export.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>7.3096</td><td bgcolor='#eeeeec' align='right'>8945408</td><td bgcolor='#eeeeec'>PhpMyAdmin\Export->compress( )</td><td title='/mnt/Dev/phpmyadmintest/export.php' bgcolor='#eeeeec'>.../export.php<b>:</b>608</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>3</td><td bgcolor='#eeeeec' align='center'>7.3348</td><td bgcolor='#eeeeec' align='right'>8946216</td><td bgcolor='#eeeeec'>PhpMyAdmin\ZipExtension->__construct( )</td><td title='/mnt/Dev/phpmyadmintest/libraries/classes/Export.php' bgcolor='#eeeeec'>.../Export.php<b>:</b>424</td></tr>
</table></font> |
|
@williamdes, Hey is this issue still there? Because Zipped Compression for a database is working fine for me on Local Server. Or if I am missing something please let me know. |
|
@kartik1000 Remove php-zip extension :) |
|
I think the reason I thought we should continue to show the zip option in the menu is so as to not confuse users if it's missing, but with 10 months of time to think about it, I think it would be more consistent with our interface to not show it there at all. |
|
@ibennetch, don't you think that warning message would be most appropriate, in case of missing extension rather than simply removing it? |
|
I agree with @kartik1000 ! |
|
You do not need any impressions in the "Compression" with warning messages that it does not work. |
|
What we should do here is not list it as type in the drop down, but do have an “i” informational button next to the drop down with a tool tip stating “Export to a zip file is not possible because the PHP Zip extension is not installed.”
|
|
@ibennetch Sorry, If so then everything is fine. |

When trying to export a database with compression set to zipped, it shows the following error
PHP Fatal error: Uncaught Error: Class 'ZipArchive' not found in /var/www/html/phpmyadmin/libraries/classes/ZipExtension.php
The text was updated successfully, but these errors were encountered: