Re: BackUp ZC [Support Thread]
Thanks for the clues. Turns out there was something in the zen directory that was overriding the global setting of PHP 5 set in the cpanel. I still don't know what it was, but I put the two lines below in my .htaccess at the zen root and it seems to have fixed things.
Quote:
AddHandler application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml
Re: BackUp ZC [Support Thread]
Hi, I need help again.
I am able to backup okay and the zip file that shows up in my backups directory seems correct. The right size and everything.
However, when I try to unzip the files I get an error message saying that the file has ended unexpectedly.
What do I need to do to fix this? Thank you!
Re: BackUp ZC [Support Thread]
Nevermind Skip,
Not sure what was going on but I downloaded the newest version and it's working again.
Thanks again, this mod rocks!
Re: BackUp ZC [Support Thread]
Quote:
Originally Posted by
skipwater
This sounds like the same error that bpryor post had
Post 7
The fix he used
So add this directory /home/content/o/u/t/outdoorking/html/stats/error_logs to the excluded list and that should fix it.
Skip
Tried to add the folder but was unable, so contacted Godaddy and they will not add the folder unless I shift from a shared server to either a dedicated one or a virtual dedicated server.
Do you have a work around?
Re: BackUp ZC [Support Thread]
Quote:
Originally Posted by
Bruce1952
Tried to add the folder but was unable, so contacted Godaddy and they will not add the folder unless I shift from a shared server to either a dedicated one or a virtual dedicated server.
Do you have a work around?
Just checking but is this how you added stats to the exclude files section?
"".DIR_FS_CATALOG."stats"
Skip
Re: BackUp ZC [Support Thread]
Skip,
Where do I find that please?
Re: BackUp ZC [Support Thread]
Getting this error in the panel as well:
Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileInfo::getSize() [<a href='splfileinfo.getsize'>splfileinfo.getsize</a>]: stat failed for /home/content/o/u/t/outdoorking/html/stats/error_logs' in /home/content/o/u/t/outdoorking/html/admin/backup_zc.php:51 Stack trace: #0 /home/content/o/u/t/outdoorking/html/admin/backup_zc.php(51): SplFileInfo->getSize() #1 /home/content/o/u/t/outdoorking/html/admin/backup_zc.php(405): directorySize('/home/content/o...') #2 {main} thrown in /home/content/o/u/t/outdoorking/html/admin/backup_zc.php on line 51
Re: BackUp ZC [Support Thread]
Quote:
Originally Posted by
Bruce1952
Skip,
Where do I find that please?
File YOUR_ADMIN/backup_zconfig.php about line 78
PHP Code:
// ***********************************************************************
// Set default exclude directories
// ***********************************************************************
$exclude_files = array("".DIR_FS_CATALOG."cache",
"".DIR_FS_CATALOG."extras",
"".DIR_FS_CATALOG."pub"
);
Change to look like this
PHP Code:
// ***********************************************************************
// Set default exclude directories
// ***********************************************************************
$exclude_files = array("".DIR_FS_CATALOG."cache",
"".DIR_FS_CATALOG."extras",
"".DIR_FS_CATALOG."pub",
"".DIR_FS_CATALOG."stats"
);
As for your cpanel error its the same error.
Skip
Re: BackUp ZC [Support Thread]
Skip,
Here is the new error message:
Notice: Undefined index: name in /home/content/o/u/t/outdoorking/html/koala/backup_zc.php on line 403
Notice: Use of undefined constant BACKUP_EXCLUDED - assumed 'BACKUP_EXCLUDED' in /home/content/o/u/t/outdoorking/html/admin/backup_zc.php on line 413
Fatal error: Uncaught exception 'RuntimeException' with message 'SplFileInfo::getSize() [<a href='splfileinfo.getsize'>splfileinfo.getsize</a>]: stat failed for /home/content/o/u/t/outdoorking/html/stats/error_logs' in /home/content/o/u/t/outdoorking/html/admin/backup_zc.php:51 Stack trace: #0 /home/content/o/u/t/outdoorking/html/admin/backup_zc.php(51): SplFileInfo->getSize() #1 /home/content/o/u/t/outdoorking/html/admin/backup_zc.php(413): directorySize('/home/content/o...') #2 {main} thrown in /home/content/o/u/t/outdoorking/html/admin/backup_zc.php on line 51
I changed as per your instructions and the above is the error message that I am getting.
Below is what is in the file after the change:
<?php
/*
***********************************************************************
$Id: backup_zconfig.php, v 1.0.5 2010/24/09
ZenCart 1.3.9f
Copyright 2003-2010 Zen Cart Development Team
Portions Copyright 2004 osCommerce
http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
Written By SkipWater <[email protected]> 05.08.10
***********************************************************************
*/
require(DIR_WS_CLASSES . 'archive.php'); // Load Archive class file
require(DIR_WS_CLASSES . 'mysql_db_backup.class.php'); // Load MySQL DB Backup class file
define(TEXT_ZCS_BACKUP_VERSION,'Version 1.0.5');
define(FILENAME_ZC_DOWNLOAD, 'backup_zc_download.php');
$zc_directory = DIR_FS_CATALOG; // Used for zen cart site size
$zc_directory_base_count = strlen(DIR_FS_CATALOG);
// ***********************************************************************
// Grab a large chunk of memory
// If your server allows this adjustment then adjust to meet your needs.
// ***********************************************************************
// ini_set("memory_limit","128M");
// ini_set("memory_limit","192M");
// ini_set("memory_limit","256M");
ini_set("memory_limit","512M"); // default
// ini_set("memory_limit","768M");
// ini_set("memory_limit","1000M");
// ***********************************************************************
// Note each directroy or file name must be surrounded with double quotes
// and a single comma with no space separating each.
// DIR_FS_CATALOG = Zen Carts root files system path you must use this and
// just add the directory you want excluded.
// Rember that directories names are case sensitive!
// ***********************************************************************
/* Sample Exclude
$exclude_files = array("".DIR_FS_CATALOG."cache",
"".DIR_FS_CATALOG."pub",
"".DIR_FS_CATALOG."admin",
"".DIR_FS_CATALOG."download"
);
*/
// ***********************************************************************
// Set default exclude directories
// ***********************************************************************
$exclude_files = array("".DIR_FS_CATALOG."cache",
"".DIR_FS_CATALOG."extras",
"".DIR_FS_CATALOG."pub",
"".DIR_FS_CATALOG."stats"
);
// ***********************************************************************
// Default Setting
// These are the settings that are used when you first request backup zc
// You can edit them if you understand them.
// ***********************************************************************
$file_name = $_SERVER['HTTP_HOST'].'_'.date("mdY-Hi"); // Create File Name
$file_ext = '.zip'; // Zip File Extention default
$archive_type = 'zip_file'; // Set as default
$file_location = DIR_FS_SQL_CACHE."/"; // Set cache directory as default
$base_directory = '.'; // Set ZC root as default
$compress_level = 3; // 1-9 1 lowest 9 highest only works with zip file
$recurse_dir = 1; // 1 = true 0 = false
$backup_file_type = '0'; // 0 = zip 1 = gzip 2 = tar
$download_backup = 0; // 1 = true 0 = false
// ***********************************************************************
// SQL Data Base info
// ***********************************************************************
$sql_path = DIR_FS_ADMIN.'backups/'; // path to SQL file default
$sql_file_name = $_SERVER['HTTP_HOST'].'_'.date("mdY-Hi").'.sql'; // Create SQL File Name
?>
Re: BackUp ZC [Support Thread]
Due to Go Daddy I have rewritten the function directorySize I can not test it because I do not have access to a Go Daddy account. So you will have to try it out.
Find the file YOUR_ADMIN/backup_zc.php replace the directorySize function about line 40.
PHP Code:
// Get the size of the web site
function directorySize($zc_directory)
{
$zc_size = 0;
foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($zc_directory)) as $file)
{
$zc_size += $file->getSize();
}
return $zc_size;
}
With this directorySize function
PHP Code:
// GoDaddy work around
function directorySize($zc_directory)
{
$zc_size = 0;
if ($handle = opendir ($zc_directory))
{
while (false !== ($file = readdir($handle)))
{
$nextpath = $zc_directory . '/' . $file;
if ($file != '.' && $file != '..' && !is_link ($nextpath))
{
if (is_dir ($nextpath))
{
$result = directorySize($nextpath);
$zc_size += $result['size'];
}
elseif (is_file ($nextpath))
{
$zc_size += filesize ($nextpath);
}
}
}
}
closedir ($handle);
return $zc_size;
}
// eof GoDaddy work around
Skip