chrometweaks.org

What do you look for in a web iPage hosting service?

Click Here To View All Answers...


My 1st question is: What do you look for in a web iPage hosting service? Hoping for any answer. 2nd question I got is.. On my database backup feature on the Admin, I get the following:.

Error: Backup directory does not exist. Please set this in configure.php..

Backup Directory: DIR_FS_ADMINbackup/.

This is what I have in the configure.php file....

Define('DIR_FS_BACKUP', DIR_FS_ADMIN'backup/');.

Can anyone tell me what is wrong with it? I mean, why won't it work?..

Comments (17)

Good question... I dunno what is the answer to that question. I'll do some investigation and get back to you if I find an useful answer. You should email the people at iPage as they probably can answer it..

Comment #1

<?php.

/*.

$Id: configure.php,v 1.14 2003/02/21 16:55:24 dgw_ Exp $.

OsCommerce, Open Source E-Commerce Solutions.

Http://www.oscommerce.com.

Copyright © 2002 osCommerce.

Released under the GNU General Public License.

*/.

// define our webserver variables.

// FS = Filesystem (physical).

// WS = Webserver (virtual).

Define('HTTP_SERVER', ''); // eg,.

Http://localhost.

Or -.

Https://localhost.

Should not be NULL for productive servers.

Define('HTTP_CATALOG_SERVER', '');.

Define('HTTPS_CATALOG_SERVER', '');.

Define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module.

Define('DIR_FS_DOCUMENT_ROOT', $DOCUMENT_ROOT); // where your pages are located on the server. if $DOCUMENT_ROOT doesnt suit you, replace with your local path. (eg, /usr/local/apache/htdocs).

//define('DIR_WS_ADMIN', 'admin/');.

Define('DIR_WS_ADMIN', '');.

Define('DIR_WS_CATALOG', '/');.

Define('DIR_FS_CATALOG', DIR_FS_DOCUMENT_ROOTDIR_WS_CATALOG);.

Define('DIR_WS_IMAGES', 'images/');.

Define('DIR_WS_ICONS', DIR_WS_IMAGES'icons/');.

Define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG'images/');.

Define('DIR_WS_INCLUDES', 'includes/');.

Define('DIR_WS_BOXES', DIR_WS_INCLUDES'boxes/');.

Define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES'functions/');.

Define('DIR_WS_CLASSES', DIR_WS_INCLUDES'classes/');.

Define('DIR_WS_MODULES', DIR_WS_INCLUDES'modules/');.

Define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES'languages/');.

Define('DIR_WS_CATALOG_LANGUAGES', DIR_WS_CATALOG'includes/languages/');.

Define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG'includes/languages/');.

Define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG'images/');.

Define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG'includes/modules/');.

Define('DIR_FS_BACKUP', DIR_FS_ADMIN'backup/');.

//define our database connection.

Define('DB_SERVER', 'xxxxxx); // eg, localhost - should not be empty for productive servers.

Define('DB_SERVER_USERNAME', 'xxxxxxxx');.

Define('DB_SERVER_PASSWORD', 'xxxxxxx');.

Define('DB_DATABASE', 'xxxxxxx');.

Define('USE_PCONNECT', 'false'); // use persistent connections?.

Define('STORE_SESSIONS', ''); // leave empty '' for default handler or set to 'mysql'.

?>..

Comment #2

Looks like you removed the define for DIR_FS_ADMIN, no?.

Should look something like ....

Define('DIR_FS_ADMIN', '/home/public_html/admin/');.

Oh and also DIR_WS_ADMIN should look like this:.

Define('DIR_WS_ADMIN', '/admin/');.

This post has been edited by.

Acheron.

: 07 July 2004, 03:53..

Comment #3

The administration itself works fine, so I don't know what making those changes would do for me. It is just the backup that I've had a problem with ever since I installed OSCommerce...

Comment #4

I went ahead and tried those changes, but like I thought, it made nothing on my admin side work. So I got it back to what it was..

Any ideas what is wrong with it as far as the BACKUP feature goes?..

Comment #5

This:.

Define('DIR_FS_BACKUP', DIR_FS_ADMIN'backup/');.

Should be:.

Define('DIR_FS_BACKUP', DIR_FS_ADMIN'backups/');.

The folder you have create in admin should be call.

Backups.

And chmod to 777.

The_Bear..

Comment #6

Did not work..

Still gives me the same error, just with a "s" on the end...

Comment #7

Ok, I was thinking maybe it might be a problem with the backup.php file itself? Anyone can tell me if I am right? [add_session(SUCCESS_LAST_RESTORE_CLEARED, 'success');.

Tep_redirect(tep_href_link(FILENAME_BACKUP));.

Break;.

Case 'backupnow':.

Tep_set_time_limit(0);.

$backup_file = 'db_'DB_DATABASE'-'date('YmdHis')'.sql';.

$fp = fopen(DIR_FS_BACKUP$backup_file, 'w');.

$schema = '# osCommerce, Open Source E-Commerce Solutions'"\n" ..

'#.

Http://www.oscommerce.com'.

"\n" ..

'#'"\n" ..

'# Database Backup For 'STORE_NAME"\n" ..

'# Copyright © 'date('Y')' 'STORE_OWNER"\n" ..

'#'"\n" ..

'# Database: 'DB_DATABASE"\n" ..

'# Database Server: 'DB_SERVER"\n" ..

'#'"\n" ..

'# Backup Date: 'date(PHP_DATE_TIME_FORMAT)"\n\n";.

Fputs($fp, $schema);.

$tables_query = tep_db_query('show tables');.

While ($tables = tep_db_fetch_array($tables_query)) {.

List(,$table) = each($tables);.

$schema = 'drop table if exists '$table';'"\n" ..

'create table '$table' ('"\n";.

$table_list = array();.

$fields_query = tep_db_query("show fields from "$table);.

While ($fields = tep_db_fetch_array($fields_query)) {.

$table_list[] = $fields['Field'];.

$schema .= ' '$fields['Field']' '$fields['Type'];.

If (strlen($fields['Default']) > 0) $schema .= ' default \''$fields['Default']'\'';.

If ($fields['Null'] != 'YES') $schema .= ' not null';.

If (isset($fields['Extra'])) $schema .= ' '$fields['Extra'];.

$schema .= ','"\n";.

}.

$schema = ereg_replace(",\n$", '', $schema);.

// add the keys.

$index = array();.

$keys_query = tep_db_query("show keys from "$table);.

While ($keys = tep_db_fetch_array($keys_query)) {.

$kname = $keys['Key_name'];.

If (!isset($index[$kname])) {.

$index[$kname] = array('unique' => !$keys['Non_unique'],.

'columns' => array());.

}.

$index[$kname]['columns'][] = $keys['Column_name'];.

}.

While (list($kname, $info) = each($index)) {.

$schema .= ','"\n";.

$columns = implode($info['columns'], ', ');.

If ($kname == 'PRIMARY') {.

$schema .= ' PRIMARY KEY ('$columns')';.

} elseif ($info['unique']) {.

$schema .= ' UNIQUE '$kname' ('$columns')';.

} else {.

$schema .= ' KEY '$kname' ('$columns')';.

}.

}.

$schema .= "\n"');'"\n\n";.

Fputs($fp, $schema);.

// dump the data.

$rows_query = tep_db_query("select "implode(',', $table_list)" from "$table);.

While ($rows = tep_db_fetch_array($rows_query)) {.

$schema = 'insert into '$table' ('implode(', ', $table_list)') values (';.

Reset($table_list);.

While (list(,$i) = each($table_list)) {.

If (!isset($rows[$i])) {.

$schema .= 'NULL, ';.

} elseif (tep_not_null($rows[$i])) {.

$row = addslashes($rows[$i]);.

$row = ereg_replace("\n#", "\n".'\#', $row);.

$schema .= '\''$row'\', ';.

} else {.

$schema .= '\'\', ';.

}.

}.

$schema = ereg_replace(', $', '', $schema)');'"\n";.

Fputs($fp, $schema);.

}.

}.

Fclose($fp);.

If (isset($HTTP_POST_VARS['download']) && ($HTTP_POST_VARS['download'] == 'yes')) {.

Switch ($HTTP_POST_VARS['compress']) {.

Case 'gzip':.

Exec(LOCAL_EXE_GZIP' 'DIR_FS_BACKUP$backup_file);.

$backup_file .= '.gz';.

Break;.

Case 'zip':.

Exec(LOCAL_EXE_ZIP' -j 'DIR_FS_BACKUP$backup_file'.zip 'DIR_FS_BACKUP$backup_file);.

Unlink(DIR_FS_BACKUP$backup_file);.

$backup_file .= '.zip';.

}.

Header('Content-type: application/x-octet-stream');.

Header('Content-disposition: attachment; filename='$backup_file);.

Readfile(DIR_FS_BACKUP$backup_file);.

Unlink(DIR_FS_BACKUP$backup_file);.

Exit;.

} else {.

Switch ($HTTP_POST_VARS['compress']) {.

Case 'gzip':.

Exec(LOCAL_EXE_GZIP' 'DIR_FS_BACKUP$backup_file);.

Break;.

Case 'zip':.

Exec(LOCAL_EXE_ZIP' -j 'DIR_FS_BACKUP$backup_file'.zip 'DIR_FS_BACKUP$backup_file);.

Unlink(DIR_FS_BACKUP$backup_file);.

}.

$messageStack->add_session(SUCCESS_DATABASE_SAVED, 'success');.

}.

Tep_redirect(tep_href_link(FILENAME_BACKUP));.

Break;.

Case 'restorenow':.

Case 'restorelocalnow':.

Tep_set_time_limit(0);.

If ($action == 'restorenow') {.

$read_from = $HTTP_GET_VARS['file'];.

If (file_exists(DIR_FS_BACKUP$HTTP_GET_VARS['file'])) {.

$restore_file = DIR_FS_BACKUP$HTTP_GET_VARS['file'];.

$extension = substr($HTTP_GET_VARS['file'], -3);.

If ( ($extension == 'sql') || ($extension == '.gz') || ($extension == 'zip') ) {.

Switch ($extension) {.

Case 'sql':.

$restore_from = $restore_file;.

$remove_raw = false;.

Break;.

Case '.gz':.

$restore_from = substr($restore_file, 0, -3);.

Exec(LOCAL_EXE_GUNZIP' '$restore_file' -c > '$restore_from);.

$remove_raw = true;.

Break;.

Case 'zip':.

$restore_from = substr($restore_file, 0, -4);.

Exec(LOCAL_EXE_UNZIP' '$restore_file' -d 'DIR_FS_BACKUP);.

$remove_raw = true;.

}.

If (isset($restore_from) && file_exists($restore_from) && (filesize($restore_from) > 15000)) {.

$fd = fopen($restore_from, 'rb');.

$restore_query = fread($fd, filesize($restore_from));.

Fclose($fd);.

}.

}.

}.

} elseif ($action == 'restorelocalnow') {.

$sql_file = new upload('sql_file');.

If ($sql_file->parse() == true) {.

$restore_query = fread(fopen($sql_file->tmp_filename, 'r'), filesize($sql_file->tmp_filename));.

$read_from = $sql_file->filename;.

}.

}.

If (isset($restore_query)) {.

$sql_array = array();.

$sql_length = strlen($restore_query);.

$pos = strpos($restore_query, ';');.

For ($i=$pos; $i<$sql_length; $i++) {.

If ($restore_query[0] == '#') {.

$restore_query = ltrim(substr($restore_query, strpos($restore_query, "\n")));.

$sql_length = strlen($restore_query);.

$i = strpos($restore_query, ';')-1;.

Continue;.

}.

If ($restore_query[($i+1)] == "\n") {.

For ($j=($i+2); $j<$sql_length; $j++) {.

If (trim($restore_query[$j]) != '') {.

$next = substr($restore_query, $j, 6);.

If ($next[0] == '#') {.

// find out where the break position is so we can remove this line (#comment line).

For ($k=$j; $k<$sql_length; $k++) {.

If ($restore_query[$k] == "\n") break;.

}.

$query = substr($restore_query, 0, $i+1);.

$restore_query = substr($restore_query, $k);.

// join the query before the comment appeared, with the rest of the dump.

$restore_query = $query$restore_query;.

$sql_length = strlen($restore_query);.

$i = strpos($restore_query, ';')-1;.

Continue 2;.

}.

Break;.

}.

}.

If ($next == '') { // get the last insert query.

$next = 'insert';.

}.

If ( (eregi('create', $next)) || (eregi('insert', $next)) || (eregi('drop t', $next)) ) {.

$next = '';.

$sql_array[] = substr($restore_query, 0, $i);.

$restore_query = ltrim(substr($restore_query, $i+1));.

$sql_length = strlen($restore_query);.

$i = strpos($restore_query, ';')-1;.

}.

}.

}.

Tep_db_query("drop table if exists address_book, address_format, banners, banners_history, categories, categories_description, configuration, configuration_group, counter, counter_history, countries, currencies, customers, customers_basket, customers_basket_attributes, customers_info, languages, manufacturers, manufacturers_info, orders, orders_products, orders_status, orders_status_history, orders_products_attributes, orders_products_download, products, products_attributes, products_attributes_download, prodcts_description, products_options, products_options_values, products_options_values_to_products_options, products_to_categories, reviews, reviews_description, sessions, specials, tax_class, tax_rates, geo_zones, whos_online, zones, zones_to_geo_zones");.

For ($i=0, $n=sizeof($sql_array); $i<$n; $i++) {.

Tep_db_query($sql_array[$i]);.

}.

Tep_db_query("delete from "TABLE_CONFIGURATION" where configuration_key = 'DB_LAST_RESTORE'");.

Tep_db_query("insert into "TABLE_CONFIGURATION" values ('', 'Last Database Restore', 'DB_LAST_RESTORE', '"$read_from"', 'Last database restore file', '6', '', '', now(), '', '')");.

If (isset($remove_raw) && ($remove_raw == true)) {.

Unlink($restore_from);.

}.

$messageStack->add_session(SUCCESS_DATABASE_RESTORED, 'success');.

}.

Tep_redirect(tep_href_link(FILENAME_BACKUP));.

Break;.

Case 'download':.

$extension = substr($HTTP_GET_VARS['file'], -3);.

If ( ($extension == 'zip') || ($extension == '.gz') || ($extension == 'sql') ) {.

If ($fp = fopen(DIR_FS_BACKUP$HTTP_GET_VARS['file'], 'rb')) {.

$buffer = fread($fp, filesize(DIR_FS_BACKUP$HTTP_GET_VARS['file']));.

Fclose($fp);.

Header('Content-type: application/x-octet-stream');.

Header('Content-disposition: attachment; filename='$HTTP_GET_VARS['file']);.

Echo $buffer;.

Exit;.

}.

} else {.

$messageStack->add(ERROR_DOWNLOAD_LINK_NOT_ACCEPTABLE, 'error');.

}.

Break;.

Case 'deleteconfirm':.

If (strstr($HTTP_GET_VARS['file'], '..')) tep_redirect(tep_href_link(FILENAME_BACKUP));.

Tep_remove(DIR_FS_BACKUP'/'$HTTP_GET_VARS['file']);.

If (!$tep_remove_error) {.

$messageStack->add_session(SUCCESS_BACKUP_DELETED, 'success');.

Tep_redirect(tep_href_link(FILENAME_BACKUP));.

}.

Break;.

}.

}.

// check if the backup directory exists.

$dir_ok = false;.

If (is_dir(DIR_FS_BACKUP)) {.

If (is_writeable(DIR_FS_BACKUP)) {.

$dir_ok = true;.

} else {.

$messageStack->add(ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE, 'error');.

}.

} else {.

$messageStack->add(ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST, 'error');.

}.

?>.

>.

]..

Comment #8

Im using osc 2.2ms2.

And I used used the Bears instructions to set up my backup database - works perfectly.

Thanks..

Comment #9

It looks like you may have some setting incorrect in your admin configure.php file, post it here without the database info, password, etc...

Comment #10


This question was taken from a support group/message board and re-posted here so others can learn from it.