I tried to take a backup of my WordPress site using Duplicator but was struck down immediately with a problem I’ve never seen before: a PHP support failure.
In this post I’ll share what I did to solve this nuisance issue.
ZipArchive Failure
Below is a screenshot of exactly what happened. I am using the latest version of WordPress and the latest version of PHP on my GoDaddy Linux shared host.
I expanded the window and learned that something called ZipArchive had failed.
Without this crucial functionality I wouldn’t be able to make my backup.
Unable to Build Package
This is the first time such an error has occurred but it isn’t the first time a plugin has become unstable.
WordPress plugins (especially free ones) should not be relied upon for any crucial part of business website backup.
Despite trying to wean myself off backup plugins I still wanted to get this one repaired. When it works it works well.
This post might also help if you’re using BackUpBuddy or another plugin using zip file compression to build archive packages.
I’ll walk you through my experiences with screenshots included. The solution is at the end.
Problem with the Host?
After some quick research I was certain this is something GoDaddy would have to deal with their end.
Most of the forum threads indicated I would need to have a conversation with the host and get them to resolve it.
Here’s a few links I found:
Zip Extension: How to Turn On? Please Help
ZipArchive extension required for compression
GoDaddy Phone Call
Once I got through on the phone I explained I’d been talking to the hosting support earlier in the day regarding php.ini and that in the course of that conversation the technician had upgraded my version of PHP to 5.4.36 as well as making some changes to php.ini.
It was my opinion that something might have happened that had stopped ZipArchive working.
I would turn out to be right.
It was nothing to do with version compatibility as is usually the case with plugins.
While I talked to GoDaddy support I searched online, combing the Life In The Grid support knowledgebase (they’re the authors of Duplicator).
I found the following link which proved useful:
The section titled Working with PHP ZipArchive suggested looking in the Duplicator settings to check if ZipArchive was enabled.
Here’s what it suggests:
“For creating Packages the Duplicator currently requires the ZipArchive class to be installed and working. For installing a package it is not required. Below are instructions for getting the ZipArchive working in your environment if it is not already setup.
ON HOSTED SERVERS
Just contact your hosting provider and tell them you want PHP with Zip support so that the “ZipArchive Class” will work. This is a very common feature and is available on almost all shared hosting environments. Please view the following link for a list of approved hosting companies that we personally recommend for working with the Duplicator.”
By the way, some of that above information is out of date: you want Duplicator > Tools > Diagnostics > PHP Information.
Once I was on the right part I took a screenshot of what I could see:
Notice how --enable-zip=shared
is visible.
This means ZipArchive is enabled but for whatever reason was not being detected by my PHP configuration.
Me and the Godaddy technician were stumped. Stumped I tells ya.
We continued discussing the problem until the answer presented itself.
The Solution: extension=zip.so
The Working with PHP ZipArchive section of the Life In The Grid knowledgebase had the solution.
The fix was that I needed to add a single line of code to php.ini.
“ON YOUR COMPUTER
On your own computer you will to to make sure the Zip extensions are enabled for PHP. Check your php.ini file for the following:
On Windows: extension=php_zip.dll
On MAC and Linux: extension=zip.so”
Seeing as I am a user of GoDaddy Linux Shared hosting I dropped extension=zip.so
in my php.ini.
ZipArchive was enabled all along, but the additional command line gave what I describe as “the kiss of life” to the PHP configuration.
After I copied php.ini to the server root I logged into cPanel and visited the PHP processes area.
From there I killed all the processes to flush the PHP cache and then went back to my WP dashboard to refresh the Duplicator package build area.
So yeah… it worked! What a relief. Here’s screenshot showing all Duplicator requirements as having passed:
To be doubly sure everything was okay I built a new package. This went without incident.
Summary: Don’t Rely on WordPress Database Backup Plugins
If you’re using Duplicator, I hope this has helped. I also hope you will not rely completely on automatic plugins for backing up WordPress sites.
It’s strongly advised to take manual WordPress backups in addition to creating .zip archive packages.
You’ll sleep much better at night knowing you have multiple options for taking database backups.
Here’s my own manual (cleaner) method of backing up a WordPress database using mysqldump via a command line interface called PuTTY.
More WordPress Warnings and Good Practice
🏗️ WAMP Server Stack: localhost for Development and Testing
🧐 WP Migrate DB: Free WordPress Database URL Replacement Script
😓 Dodge WordPress Website Disasters: Use a Localhost for Development
🧐 Can We Really Trust WordPress Plugins? Back Up Your Site Manually NOW
👀 This WordPress Media Uploader Problem Makes Your Blog Look Amateur
Thanks for some tips on Duplicator. I was having the same problem on my site and I don’t know how to fix it. Glad that I’ve found your blog.
Cheers,
Mark
Thanks Darren I am glad you mention these problems since I am creating my site on GoDaddy Linux hosting. Have considered buying BackUpBuddy but not yet because Duplicator is free and seems to have a good reputation.
Thanks for this I feel you’ve saved me a potential headache down the road!
All the best,
Paul Gregory
I have tried BackUpBuddy before but cancelled the subscription. I felt it was overpriced and it still gave me a lot of trouble with timeouts.
Legend. Thank you.
Hi Darren,
thank you very much for your help!
You succeed where three developers didn’t.
I am very grateful to you!
You’re welcome. The Life in the Grid knowledge base gave me the idea to try something with php.ini.
The GoDaddy support people said the Duplicator issue had been bothering them for a while. I hope my solution helped them too and they were able to pass the tip onto their customers.
Thanks, maybe I didn’t use it for duplicator, but I was having the same ZipArchive issue when installing OctoberCMS on GoDaddy and following your advice is now installed and working. Regards.
What’s OctoberCMS? Is that a shared hosting application, a one click install thing? Glad it worked for you.
Perfect solution. I also thought I would share the in Godaddy shared hosting, that under the PHP version you can select “Zip” because mine was unchecked by default. Once I killed the process and refreshed I got a PASS – WOO HOO!!!
Excellent suggestion Chris! This works for me. Many thanks
Excellent idea bro..after struggling for 2 hrs, i found your solution. it is just one second job. u r great.
Thank you for this, Chris!
This was exactly what my client’s setup needed. 🙂
I’ve got a dedicated server, does this solution work for that? I can’t tell.
I’m not sure, presently. All I can suggest is that you try it and see. You’re with GoDaddy, I take it?
Forgive me, for I’m not the most advanced with this sort of stuff. Quite the beginner. I’m not quite sure how to edit the php.ini file. From what i’ve read, it’s actually called something else in godaddy hosting now, and I’m not able to find it at all. I read a guide on how to edit the php.ini file, and they suggested just creating a new php.ini file with the edits you wanted to make in the public_html folder, but I tried that and it didn’t seem to work for me at all. Still getting the php fail in Duplicator. Help?
I have the same question
My php.ini file is in the public_html folder. That is the name of the root server folder under a GoDaddy shared Linux server.
I copied the php.ini file to my desktop, edited it with Notepad++ and dropped in the extension=zip.so line.
This is awesome, Darren! This is literally the exact issue I was having today and this fixed it. Thank you so much for putting this up and saving me potentially hours of troubleshooting and a massive headache.
i configured my own server from jiffybox but this solution is not working. I have checked the info.php file and it says “Phar-based phar archives enabled
Tar-based phar archives enabled
ZIP-based phar archives enabled
gzip compression enabled
bzip2 compression enabled” but it is still giving me the same error. Any solutions?
I only used this solution for Linux cPanel shared hosting… I’ve never used jiffybox.
Thanks a lot for writing this article. Saved me 🙂
You’re welcome. Tell me, is Duplicator the only plugin you use for cloning websites? Have you tried any others, like WP Migrate DB?
This was great, thanks for your post. Keeps on giving!
Thank you for writing this! Saved me a tech support chat and was able to immediately translate my initial fail into a pass.
I’m surprised out many people are finding this to be the solution. I kind of stumbled across it. Are you on GoDaddy too?
hi and thanks for this procedure
unfortunately i cannot find my php.ini file in my godaddy file manager…
using filezilla i searched into etc but it isn’t there, and also after having downloaded locally, searching everywhere but nothing…
do you know where is it located?
an update:
after having launched phpinfo() I know that my location is:
/opt/alt/php71/etc/php.ini
but I cannot access there and so nor to my ini file
how can i do?
thanks
I talk about php.ini in the post, not phpinfo.php – You might not need the latter in this case since the Duplicator error reports should tell you whether or not the ZipArchive is enabled.
Go ahead and create your php.ini file to your public root folder – the same folder that your index.html or index.php is in.
If your on godaddy hosting its very easy no need to edit stuff by hand just need to know where to go in cpanel.
its a bit misleading on the main screen scroll down to software and click change php version in the page that opens you will see the version your using and the option to change it, below this you will see an ocean of checkboxes for the different modules you can turn on or off you will find the zip option near the end, check it then click save and rock on. if you want to set your timeouts and file max sized click on switch to php options in the upper right. Hope this helps!
It might be helpful.
If your hosted on Godaddy:
Cpanel>Select PHP version> Check ZIP > Save
If your missing zip on php then PHP PEAR Packages>search Zip>Install
Hope it help.
Thank you so much! Much easier and worked perfectly.
I did this as well. Worked immediately.
you saved my day
i had mini heart attack when it was not working properly…
I can’t find it, using godaddy and cpanel
Create it yourself and drop into the public_html folder.
Thank you so much to provide the tip!
I can’t find php.ini in my files, using cpanel
did the file name change? and where is it now?
Thanks, Darren. Three years later and this post is exactly what I needed.
Thanks for taking the time to document this. I found a much quicker solution on my GoDaddy cpanel … in cpanl just go to Select PHP Version, then in the extensions click the box next to “zip”, then save … and viola.
Thank you!
I had updated my php version from php 5 to php 7 (on my local dev machine) and ran into this issue. In my case installing the php7-zip package with
sudo apt-get install php7.0-zip
sudo service apache2 restart
did the trick. (Obviously one would need shell access for this)
Source:
https://www.digitalocean.com/community/questions/php-7-0-ziparchive-library-is-missing-or-disabled
Your post saved me a lot of time. All I had to do with the cpanel version I was working with was to got to cpanel, then select php version. From there all I had to do was check the zip checkbox
You’re amazing. Thanks brother!
Thanks Chris Schondel for the zip tip and Thanks Darren.
Bruh, this comment saved me soooo much frustration. THANK YOU!!!
Thanks a lot, it works perfectly.
You’re great. Thanks, brother!
I was more than happy to uncover this great site. I need to to thank you for your time due to this fantastic read!! I definitely enjoyed every bit of it and I have you bookmarked to see new information on your blog.