There are several solutions: 1. Most likely it is timed out. increase the timeout. 2. put git ipo krone to do autocommit and push on the original 3. or score apparently your deshmansky host, or generally free, and something optimized for it is unrealistic
add output to script
function zipData($source, $destination) { if (extension_loaded('zip')) { if (file_exists($source)) { $zip = new ZipArchive(); echo 'create zip archive'.PHP_EOL; if ($zip->open($destination, ZIPARCHIVE::CREATE)) { $source = realpath($source); echo realpath($source).PHP_EOL; if (is_dir($source)) { $iterator = new RecursiveDirectoryIterator($source); // skip dot files while iterating $iterator->setFlags(RecursiveDirectoryIterator::SKIP_DOTS); $files = new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::SELF_FIRST); foreach ($files as $file) { // echo $file . '<BR>' ; echo $file.PHP_EOL; if (strpos($file, 'backup') === false) { $file = realpath($file); if (is_dir($file)) { $zip->addEmptyDir(str_replace($source . '/', '', $file . '/')); } else if (is_file($file)) { $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file)); } } } } else if (is_file($source)) { $zip->addFromString(basename($source), file_get_contents($source)); } } return $zip->close(); } } return false; }
and run using php -f backup.php
where backup.php
your script. After we look where and why it fell off. It is also necessary to add display_error(E_ALL)
at the beginning of the script to display errors in the execution process.