Debug code is BMI-xxFKcg3T-46541.
Recently added on WooCommerce and roughly 40k items with graphics which has made the backups much larger. Before the inventory our backups were about 2GB. After the inventory, uncompressed it would be over 8GB. Watching the back end of the process from SSH, I can see the zip file growing over 4GB and then when it hits the last step it suddenly shrinks to 700 MB. The zip is corrupt and cannot be opened at all.
In the following image, “BM_Backup_2023-11-15_22_24_00_yrjfJWlqUtCg3bF1.zip” is the file I was currently backing up, while “’BM_Backup_2023-11-05_11_24_55_WkCVDyNfFu8x4Lpl – PREDIAMONDS.zip’” is from before I added WooCommerce. You can see how the file grows from 3.7 GB at 22:35 to 4.4GB at 22:37 then suddenly drops to 711MB at 22:38.
]]>Indicating SHELL EXEC is not enabled in the PHP running with this version of XAMPP.
However, when I inspect the php.ini file the variable disabled_functions is empty, meaning that shell_exec is not disabled. Still the installer can’t find it.
Any clue on how to resolve this issue?
]]>Your server does not support the PHP ZipArchive class. This is required in order for multiple file digital downloads to work in Sunshine. Please ask your web host to enable this for your website.
First I logged into my hosting cpanel, went to PHP PEAR Packages and installed Archive_Zip 0.1.2 on my server. It’s still giving me the same message. Not sure where to go now. Before I put in a service ticket on my webhosting, I thought I would just check in here in case there’s some simple step I’m missing.
]]>Unfortunately, we cannot import/export our Fusion Sliders because SiteGround has not loaded the ZipArchive extension into its PHP 7.4.3 module.
Natively, PHP 7.4.3 has the ZipArchive extension installed (click here for PHP’s changelog)
In order to import/export our Fusion Sliders, we are constantly downgrading PHP to 7.3.15 (using SG Optimizer) which includes the ZipArchive extension.
Please review and load the ZipArchive extension into PHP 7.4.3. There are no known safety issues or concerns out there!
Thank you!
]]>My guess is that the acf fields are updated last on update and that is why I get the old values instead of the new ones. Because I delete the complete zip file and then recreate it, which means that the function creates the exact same zip file as before, even though it should’ve been changed.
So I have tried to use different hooks: save_post, save_post_post, acf/save_post and publish_post. I got the same results no matter what. I also tried different priorities on each, 0,1, 999 and 99999. Still the same results.
I also tried getting the field values with $_POST[‘acf’] and get_fields. With $_POST[‘acf’] nothing works, I cannot even delete the zip file when using the post variable. I looked at all the data which I need for the zipping and deleting process and it is the same as my other solution.
In the following code I commented the code snippets that do not work at all and replaced it with the code snippets that do work but only create the zip I want when I click on update a second time.
I also tried adding the hook before the start of the function and after the function. Didnt seem to have an effect at all.
I know that deleting the complete zip file and reacreating it completly isnt the best practice, I also had a nice code snippet that would only delete the files that werent there anymore, but I dont know how many files will be needed, so it could be that there needs to be a custom fieldgroup for each post, with 20 files to upload or 2 files and I thought when I delete everything first it doesnt matter.
add_action(‘acf/save_post’ , ‘archive_upload’, 10, 3);
function archive_upload($post_ID){
$destination = ‘wp-content/uploads/archiv/’. hash(‘md5′, $post_ID).’.zip’;
$zip = new ZipArchive();
$zip->open( $destination, ZipArchive::CREATE );
$fields = get_fields($post_ID);
//$fields = $_POST[‘acf’];
if($fields != ”){
$fieldslength = count($fields);
$i = 0;
while( $i < $fieldslength )
{
$zip->deleteIndex($i);
$i++;
}
$zip->close();
$zip = new ZipArchive();
$zip->open( $destination, ZipArchive::CREATE );
if( count( $fields ) ) {
$i = 0;
foreach( $fields as $field ) {
$info .= ” “.$field;
/*if($field){
$key = key($fields);
$upload = get_field($key);
$new_filename = $upload[‘filename’];
$url = get_attached_file($upload[‘id’]);
$info .= ” “.$key.” “.$url.” “.$new_filename;
$zip->addFile( $url, $new_filename );
$i++;
}
next($fields);*/
$new_filename = $field[‘filename’];
$url = get_attached_file($field[‘id’]);
$info .= ” “.$url.” “.$new_filename;
$zip->addFile( $url, $new_filename );
}
}
//die($info);
}
}
$zip->close();
}
/*function custom_hook() {
do_action(‘custom_hook’);
}
add_action(‘custom_hook’, ‘archive_upload’);*/
My guess is that the acf fields are updated last on update and that is why I get the old values instead of the new ones. Because I delete the complete zip file and then recreate it, which means that the function creates the exact same zip file as before, even though it should’ve been changed.
So I have tried to use different hooks: save_post, save_post_post, acf/save_post and publish_post. I got the same results no matter what. I also tried different priorities on each, 0,1, 999 and 99999. Still the same results.
I also tried getting the field values with $_POST[‘acf’] and get_fields. With $_POST[‘acf’] nothing works, I cannot even delete the zip file when using the post variable. I looked at all the data which I need for the zipping and deleting process and it is the same as my other solution.
In the following code I commented the code snippets that do not work at all and replaced it with the code snippets that do work but only create the zip I want when I click on update a second time.
I also tried adding the hook before the start of the function and after the function. Didnt seem to have an effect at all.
I know that deleting the complete zip file and reacreating it completly isnt the best practice, I also had a nice code snippet that would only delete the files that werent there anymore, but I dont know how many files will be needed, so it could be that there needs to be a custom fieldgroup for each post, with 20 files to upload or 2 files and I thought when I delete everything first it doesnt matter.
add_action('acf/save_post' , 'archive_upload', 10, 3);
function archive_upload($post_ID){
$destination = 'wp-content/uploads/archiv/'. hash('md5', $post_ID).'.zip';
$zip = new ZipArchive();
$zip->open( $destination, ZipArchive::CREATE );
$fields = get_fields($post_ID);
//$fields = $_POST['acf'];
if($fields != ''){
$fieldslength = count($fields);
$i = 0;
while( $i < $fieldslength )
{
$zip->deleteIndex($i);
$i++;
}
$zip->close();
$zip = new ZipArchive();
$zip->open( $destination, ZipArchive::CREATE );
if( count( $fields ) ) {
$i = 0;
foreach( $fields as $field ) {
$info .= " ".$field;
/*if($field){
$key = key($fields);
$upload = get_field($key);
$new_filename = $upload['filename'];
$url = get_attached_file($upload['id']);
$info .= " ".$key." ".$url." ".$new_filename;
$zip->addFile( $url, $new_filename );
$i++;
}
next($fields);*/
$new_filename = $field['filename'];
$url = get_attached_file($field['id']);
$info .= " ".$url." ".$new_filename;
$zip->addFile( $url, $new_filename );
}
}
//die($info);
}
}
$zip->close();
}
/*function custom_hook() {
do_action('custom_hook');
}
add_action('custom_hook', 'archive_upload');*/
]]>[10-Nov-2018 11:05:01] AVERTISSEMENT : ZipArchive::close(): Write error: File too large
[10-Nov-2018 11:05:01] ERREUR : L’archive ZIP ne peut pas être fermée correctement
Would you have a solution? Does the Pro version of BackWPup allow to split transmitted files to lighten the weight?
]]>“An error occurred while attempting to export personal data. Unable to generate export file. ZipArchive not available.”
How can I fix this?
]]>