Author Topic: change url and/or server; Move 4images to new server  (Read 44221 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: hi @vano
« Reply #15 on: June 06, 2003, 12:29:32 PM »
Quote from: Art1977
where do i do this?

8O
CHMOD?
check /docs/installation.txt
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline CharlieS

  • Pre-Newbie
  • Posts: 5
    • View Profile
    • http://allalias.com
change url and/or server; Move 4images to new server
« Reply #16 on: June 10, 2003, 06:39:21 AM »
I did that and then uploaded the files and when I go to the page I get this:

Quote
template_extension)) { $template = ""; } else { $main_template = $template; } } else { $template = ""; } include(ROOT_PATH.'includes/page_header.php'); if (!empty($template)) { $clickstream = "url(ROOT_PATH."index.php")."\">".$lang['home']."".$config['category_separator'].str_replace("_", " ", ucfirst($template)); $site_template->register_vars("clickstream", $clickstream); $site_template->print_template($site_template->parse_template($main_template)); include(ROOT_PATH.'includes/page_footer.php'); } //----------------------------------------------------- //--- Show Categories --------------------------------- //----------------------------------------------------- $categories = get_categories(0); if (!$categories) { $categories = $lang['no_categories']; } $site_template->register_vars("categories", $categories); unset($categories); //----------------------------------------------------- //--- Show New Images --------------------------------- //----------------------------------------------------- $imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']); if ((substr($config['image_table_width'], -1)) == "%") { $imgtable_width .= "%"; } $additional_sql = ""; if (!empty($additional_image_fields)) { foreach ($additional_image_fields as $key => $val) { $additional_sql .= ", i.".$key; } } $num_new_images = $config['image_cells']; $sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")." FROM ".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id) WHERE i.image_active = 1 AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").") ORDER BY i.image_date DESC LIMIT $num_new_images"; $result = $site_db->query($sql); $num_rows = $site_db->get_numrows($result); if (!$num_rows) { $new_images = "
"; $new_images .= $lang['no_new_images']; $new_images .= "
"; } else { $new_images = "
"; $count = 0; $bgcounter = 0; while ($image_row = $site_db->fetch_array($result)){ if ($count == 0) { $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2; $new_images .= "
\n"; } $new_images .= "
\n"; $count++; if ($count == $config['image_cells']) { $new_images .= "
\n"; $count = 0; } } // end while if ($count > 0) { $leftover = ($config['image_cells'] - $count); if ($leftover >= 1) { for ($f = 0; $f < $leftover; $f++) { $new_images .= "
\n"; } $new_images .= "
\n"; } } $new_images .= "
\n"; show_image($image_row); $new_images .= $site_template->parse_template("thumbnail_bit"); $new_images .= "\n
\n \n
\n"; } // end else $site_template->register_vars("new_images", $new_images); unset($new_images); //----------------------------------------------------- //--- Print Out --------------------------------------- //----------------------------------------------------- $site_template->register_vars(array( "msg" => $msg, "clickstream" => $clickstream )); $site_template->print_template($site_template->parse_template($main_template)); include(ROOT_PATH.'includes/page_footer.php'); ?>


and in install.php

Quote
$val) { $array[$key] = (is_array($val)) ? addslashes_array($val) : addslashes($val); } return $array; } if (get_magic_quotes_gpc() == 0) { $HTTP_GET_VARS = addslashes_array($HTTP_GET_VARS); $HTTP_POST_VARS = addslashes_array($HTTP_POST_VARS); $HTTP_COOKIE_VARS = addslashes_array($HTTP_COOKIE_VARS); } if (@file_exists(ROOT_PATH."config.php")) { @include(ROOT_PATH.'config.php'); } if (defined("4IMAGES_ACTIVE")) { header("Location: index.php"); exit; } if (isset($HTTP_GET_VARS['action']) || isset($HTTP_POST_VARS['action'])) { $action = (isset($HTTP_GET_VARS['action'])) ? stripslashes(trim($HTTP_GET_VARS['action'])) : stripslashes(trim($HTTP_POST_VARS['action'])); } else { $action = ""; } if ($action == "") { $action = "intro"; } $lang_select = ""; $folderlist = array(); $handle = opendir(ROOT_PATH."lang"); while ($folder = @readdir($handle)) { if (@is_dir(ROOT_PATH."lang/$folder") && $folder != "." && $folder != "..") { $folderlist[] = $folder; } } sort($folderlist); for($i = 0; $i < sizeof($folderlist); $i++) { $lang_select .= " ".$folderlist[$i]." \n"; } closedir($handle); if (isset($HTTP_GET_VARS['install_lang']) || isset($HTTP_POST_VARS['install_lang'])) { $install_lang = (isset($HTTP_GET_VARS['install_lang'])) ? trim($HTTP_GET_VARS['install_lang']) : trim($HTTP_POST_VARS['install_lang']); } if (empty($install_lang) || !in_array($install_lang, $folderlist)) { $install_lang = "deutsch"; } $lang = array(); include(ROOT_PATH.'lang/'.$install_lang.'/install.php'); $db_servertype = (isset($HTTP_POST_VARS['db_servertype'])) ? trim($HTTP_POST_VARS['db_servertype']) : "mysql"; $db_host = (isset($HTTP_POST_VARS['db_host'])) ? trim($HTTP_POST_VARS['db_host']) : ""; $db_name = (isset($HTTP_POST_VARS['db_name'])) ? trim($HTTP_POST_VARS['db_name']) : ""; $db_user = (isset($HTTP_POST_VARS['db_user'])) ? trim($HTTP_POST_VARS['db_user']) : ""; $db_password = (isset($HTTP_POST_VARS['db_password'])) ? trim($HTTP_POST_VARS['db_password']) : ""; $table_prefix = (isset($HTTP_POST_VARS['table_prefix'])) ? trim($HTTP_POST_VARS['table_prefix']) : "4images_"; $admin_user = (isset($HTTP_POST_VARS['admin_user'])) ? trim($HTTP_POST_VARS['admin_user']) : ""; $admin_password = (isset($HTTP_POST_VARS['admin_password'])) ? trim($HTTP_POST_VARS['admin_password']) : ""; $admin_password2 = (isset($HTTP_POST_VARS['admin_password2'])) ? trim($HTTP_POST_VARS['admin_password2']) : ""; include(ROOT_PATH.'includes/constants.php'); if ($action == "downloadconfig") { header("Content-Type: text/x-delimtext; name=\"config.php\""); header("Content-disposition: attachment; filename=config.php"); $config_file = stripslashes(trim($HTTP_POST_VARS['config_file'])); echo $config_file; exit; } ?>

$val) { $lang[$key] = sprintf("%s *", $lang[$key]); } $action = "intro"; } else { ?>
connection) { $error_log[] = "No connection to database!"; } $site_db->no_error = 1; include(ROOT_PATH.'includes/db_utils.php'); $db_file = ROOT_PATH.DATABASE_DIR."/default/".strtolower($db_servertype)."_default.sql"; $cont = @fread(@fopen($db_file, 'r'), @filesize($db_file)); if (empty($cont)) { $error_log[] = "Could not load: ".$db_file; } if (empty($error_log)) { $cont = preg_replace('/4images_/', $table_prefix, $cont); $pieces = split_sql_dump($cont); for ($i = 0; $i < sizeof($pieces); $i++) { $sql = trim($pieces[$i]); if (!empty($sql) and $sql[0] != "#") { if (!$site_db->query($sql)) { $error_log[] = $sql; } } } $admin_pass_md5 = md5($admin_password); $current_time = time(); $sql = "UPDATE ".$table_prefix."users SET user_name = '$admin_user', user_password = '$admin_pass_md5', user_lastaction = $current_time, user_lastvisit = $current_time WHERE user_name = 'admin'"; if (!$site_db->query($sql)) { $error_log[] = $sql; } $sql = "UPDATE ".$table_prefix."settings SET setting_value = '$install_lang' WHERE setting_name = 'language_dir'"; if (!$site_db->query($sql)) { $error_log[] = $sql; } } if (empty($error_log)) { $config_file = ''; @umask(0111); $fp = @fopen('./config.php', 'w'); $ok = @fwrite($fp, $config_file); if (!$ok) { $cant_write_config = 1; } @fclose($fp); $msg = "

".$lang['install_success'].""; if (!isset($cant_write_config)) { $msg .= "

".$lang['install_success_login']; } else { $msg .= "

".$lang['config_download_desc']; $msg .= ''; $msg .= ''; } $msg .= "
"; } else { $msg = $lang['database_error']; $error_msg .= "
"; foreach ($error_log as $val) { $error_msg .= sprintf("
%s
", $val); } $error_msg .= "
"; } ?>


"; $db_types = array("mysql"); $handle = opendir(ROOT_PATH."includes"); while ($file = @readdir($handle)) { if (preg_match("/db_(.*)\.php/", $file, $regs)) { if ($regs[1] != "mysql" && file_exists(ROOT_PATH."data/database/default/".$regs[1]."_default.sql")) { $db_types[] = $regs[1]; } } } foreach ($db_types as $db_type) { $db_servertype_select .= "".$db_type.""; } $db_servertype_select .= ""; if (!empty($error)) { $lang['start_install_desc'] = $lang['start_install_desc'].sprintf("

%s *", $lang['lostfield_error']); } ?>


 

 

 

 

 

 

 

 
 

Powered by 4images
Copyright © 2002 4homepages.de

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
change url and/or server; Move 4images to new server
« Reply #17 on: June 10, 2003, 07:16:28 AM »
are u sure that your host supports PHP?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline CharlieS

  • Pre-Newbie
  • Posts: 5
    • View Profile
    • http://allalias.com
change url and/or server; Move 4images to new server
« Reply #18 on: June 10, 2003, 06:06:06 PM »
I think so - they claim they do :?
EDIT: OK, nevermind, my host had the default PHP setting to off, didn't notice at first.

Offline CharlieS

  • Pre-Newbie
  • Posts: 5
    • View Profile
    • http://allalias.com
change url and/or server; Move 4images to new server
« Reply #19 on: June 10, 2003, 08:09:55 PM »
OK, but now I get this error:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /hsphere/local/home/allalias/allalias.net/includes/db_mysql.php on line 39

DB Error: Could not connect to the database server (, ).

NOTE: I first tried localhost as the dbhost but it didn't allow it, so I switched to the IP, and it "worked", but I got the above error.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
change url and/or server; Move 4images to new server
« Reply #20 on: June 10, 2003, 08:14:52 PM »
Quote from: CharlieS
OK, but now I get this error:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /hsphere/local/home/allalias/allalias.net/includes/db_mysql.php on line 39

DB Error: Could not connect to the database server (, ).

NOTE: I first tried localhost as the dbhost but it didn't allow it, so I switched to the IP, and it "worked", but I got the above error.
ask your host about correct info how to use MySQL server.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline CharlieS

  • Pre-Newbie
  • Posts: 5
    • View Profile
    • http://allalias.com
change url and/or server; Move 4images to new server
« Reply #21 on: June 10, 2003, 08:23:01 PM »
EDIT: Thanks, I actually realized that when I was saving a file on my computer to upload it wasn't overriding the old one, stupid me. Works now :)

Offline Art1977

  • Newbie
  • *
  • Posts: 37
    • View Profile
    • http://www.d-mack.de
I changed the permissions like in the installation.txt
« Reply #22 on: June 16, 2003, 10:01:03 PM »
I changed the permissions like in the installation.txt chmod 777

Set permissions for the following directories:

Quote
(drwxrwxrwx) : data
     chmod 777 (drwxrwxrwx) : data/database
     chmod 777 (drwxrwxrwx) : data/media
     chmod 777 (drwxrwxrwx) : data/thumbnails
     chmod 777 (drwxrwxrwx) : data/tmp_media
     chmod 777 (drwxrwxrwx) : data/tmp_thumbnails
     chmod 777 (drwxrwxrwx) : templates
     chmod 777 (drwxrwxrwx) : templates/default
     chmod 777 (drwxrwxrwx) : templates/default/media

     Set permissions for the following files:

     chmod 666 (-rw-rw-rw-) : alle Dateien im Verzeichnis "templates/default"
     chmod 666 (-rw-rw-rw-) : alle Dateien im Verzeichnis "templates/default/media"


i can add categories but if i upload pics and check for new images they are not added to the category.

also if i add manually a new user , he is not added !

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
change url and/or server; Move 4images to new server
« Reply #23 on: June 16, 2003, 10:02:47 PM »
any error messages?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Art1977

  • Newbie
  • *
  • Posts: 37
    • View Profile
    • http://www.d-mack.de
@vano
« Reply #24 on: June 16, 2003, 10:24:56 PM »
no  ,

no messages , nothing der screen reloads ! but nothing is changed

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
change url and/or server; Move 4images to new server
« Reply #25 on: June 16, 2003, 11:00:01 PM »
does it say "User added" ?
I still think u missed somewhere in the permissions...
btw, is your host running *NIX system or windows? (CHMOD doesnt work on windows systems)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline hyde101

  • Sr. Member
  • ****
  • Posts: 410
  • 34TR.COM (Running 4images)
    • View Profile
    • Nostalgia Istanbul
Re: change url and/or server; Move 4images to new server
« Reply #26 on: March 11, 2005, 09:31:47 PM »
Requirements:

phpMyAdmin on both servers (unless you know what you mean with servers)
very good FTP cleint  (I suggest Flash FXP)
very good text editor (I suggest UltraEdit-32)
patience
a little bit of knowledge of how 4images works

Can we sum the steps as:

1) Back Up the database as .sql or .zip [Old Server] *.sql recommended
2) Back Up the /4images directory entirely [Old Server]
3) Restore the database [New Server] 1 *see below
4) Note down the database information (domain, user, database, etc.) [New Server]
5) Restore /4images directory [New Server]
6) Edit config.php and other .phps under /4images to match the new domain, user, database, etc [New Server] 2 *see below

If you are making a dummy duplicate of 4images, above should work, because all the prefix and subfolders & data should match each other.

Only problem could be if there is a mod which needs to link to db and you forgot to rename/modify & give it the new db specs.

1) While restoring database, you may runinto problems during importing or while restoring the db.sql into your new db. This can cause time out and 50x errors with your server. To avoid this try restoring 4images_ tables one at a time. Try exporting 1 table, and importing 1 table, and so on.. such as start with  4images_categories and export it, later  4images_comments.. and so on. You may run into problem with tables that are over 750kb, depending on your connection and the speed of your server. What to do? Then as v@no suggested try opening the .sql file and use SQL to run SQL query/queries on database.  4images_wordmatch can cause a problem, because on mine it was 1.7MB, which consists of simple commands like

Code: [Select]
INSERT INTO 4images_wordmatch VALUES (1, 41, 0, 0, 1);
INSERT INTO 4images_wordmatch VALUES (1, 40, 0, 0, 1);
INSERT INTO 4images_wordmatch VALUES (1, 39, 0, 0, 1);
INSERT INTO 4images_wordmatch VALUES (1, 38, 0, 0, 1);
INSERT INTO 4images_wordmatch VALUES (1, 37, 0, 0, 1);
INSERT INTO 4images_wordmatch VALUES (1, 36, 0, 1, 0);
INSERT INTO 4images_wordmatch VALUES (1, 35, 0, 1, 0);

so it is pretty easy to input line by line, try doing 750 lines at a time.

2) There are only 3-5 files which needs to link to db, if you think you might have more, you will use your favorite search tool to search for file "Containing Text = xxxxx (your db or your db password)" and the result files needs to be modified to your new db information. The best text editor I found is UltraEdit-32 which can find and replace any given words in all open files at once.

Keep reading for other updates and details.

Good Luck.

  :mrgreen:

« Last Edit: March 13, 2005, 04:56:03 AM by ufkydpnr »

Please Vote for my site: Here

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: change url and/or server; Move 4images to new server
« Reply #27 on: March 12, 2005, 12:28:42 AM »
that is perfect ;)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline hyde101

  • Sr. Member
  • ****
  • Posts: 410
  • 34TR.COM (Running 4images)
    • View Profile
    • Nostalgia Istanbul
Re: change url and/or server; Move 4images to new server
« Reply #28 on: March 12, 2005, 02:35:39 AM »
Boy, it means a lot coming from you.

Anyway, I am working on my new server now, I just set up phpmyadmin, *new version seems sweet, and right now will export the whole db out of my old server.

*edited and moved above.


Good Luck
« Last Edit: March 13, 2005, 04:58:03 AM by ufkydpnr »

Please Vote for my site: Here

Offline hyde101

  • Sr. Member
  • ****
  • Posts: 410
  • 34TR.COM (Running 4images)
    • View Profile
    • Nostalgia Istanbul
Re: change url and/or server; Move 4images to new server
« Reply #29 on: March 12, 2005, 07:05:44 PM »
a quick update:

phpmyadmin restricts importing of queries to (Max: 8,192KB).

I was lucky to have about 7500KB, even so, it was large enough to put the enquery into "Time Out". Therefore, the best way to do this would be table, try exporting & importing 5 tables at a time.
« Last Edit: March 13, 2005, 04:58:35 AM by ufkydpnr »

Please Vote for my site: Here