bobsi18 Posted June 3, 2010 Posted June 3, 2010 Recently, my store was moved from a MYSQL4/PHP4 environment (with register_globals on) to a MYSQL5/PHP5 server (with register_globals off). Before the store was moved, I installed mysql/php on my computer and set up a server, to try and pre-empt any errors that would occur. My store is an osCommerce 2.2 MS2 store with a lot of contributions and relevant patches installed (I plan on upgrading it to a RC2a installation once the migration is done and the store is working again). The following are the steps I had to take get my store working, some of these are specific to the contributions that I have installed, others are fundamental issues with the code. The main contributions that caused errors were Image Magic and SEO URLS. To view many of the errors on my site, I had to find the error_log (on a mac it is in /var/log/apache2/error_log). I have included the errors so that, hopefully, anyone searching for solutions to these errors, will find the solutions. Most of the contributions that I have installed are fairly standard ones, so it stands to reason that others may have similar issues. Update the configure filesAs the site has been moved, I needed to update the admin/includes/configure.php, includes/configure.php, includes/phplist_define.php, admin/includes/phplist_define.php (PHP List contribution), /includes/local/configure.php (Fancy Invoice contribution) and admin/sitemonitor_configure.php (Site Monitor contribution) with the correct paths. Reset the authentication for the admin side(2)No such file or directory: Could not open password file: /.htpasswds/public_html/admin/passwdInternal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Delete the lines in the admin/.htaccess file referring to "AuthType Basic" - reinstate via cpanel. Install the register globals contributionServer Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory. I used REGISTER GLOBALS - V 1.5 - Richard Bentley 01/09/2006 (http://www.oscommerce.com/community/contributions,2097/ - Use "V 1.5 - TAR Archive" or "VV 1.5 - ZIP Archive"). I don't know if this is the best one available, but it was easy to follow, and worked for me. Just a note - the contribution files try to open in terminal on my mac for some reason (and throw errors), to open, simply right click, and open with TextEdit or similar. Upgrade SEO URLSCrazy pages of texts when clicking on catalog side I originally had Ultimate SEO URLS V2.1 installed on my site, after advice on the forums, I upgraded to Ultimate SEO URLSv22d 9 (LINK) - I had to completely ignore the "UPDATE" instructions, but rather copy over my original installation as if I was doing a new installation (whilst the code has been updated, the instruction file hasn't). Unable to determine the page link!BOX_HEADING_LANGUAGES Error! Unable to determine the page link! To fix, I needed to do a search and replace of ALL instances of $HTTP_SERVER_VARS with $_SERVER$HTTP_GET_VARS with $_GET$HTTP_POST_VARS with $_POST Image Magic IssuesIncludes: PHP Notice: Undefined variable: config_values in /imagemagic.php on line...PHP Notice: Undefined variable: page_prefix in /imagemagic.php on line...PHP Notice: Undefined variable: config_values in /imagemagic.php on line…PHP Notice: Undefined variable: image_watermark in /imagemagic.php on line…PHP Notice: Undefined variable: frame in /imagemagic.php on line...PHP Notice: Undefined variable: bevel in /imagemagic.php on line...PHP Notice: Undefined variable: text_watermark in /imagemagic.php on line...PHP Notice: Use of undefined constant file - assumed 'file' in /imagemagic.php on line… Followed by errors such as:PHP Warning: Cannot modify header information - headers already sent by (output started at /imagemagic.php:166) in /imagemagic.php on line ...PHP Warning: Cannot modify header information - headers already sent by (output started at /imagemagic.php:166) in /imagemagic.php on line ...PHP Warning: Cannot modify header information - headers already sent by (output started at /imagemagic.php:166) in /imagemagic.php on line … etc I had a devil of a time trying to fix this, I presume it is something to do with my servers configuration, as very few people seem to be complaining about it on the forums. As well as the above errors, the images weren't showing up when imagemagic was on. In the end, I discovered that the different variables needed to be set, so in imagemagic.php, find: while ($row = @mysql_fetch_array($result)) { if ($row['cfgKey'] != "LAST_HASH") $config_values.=$row['cfgKey'].'='.$row['cfgValue']; //to be fed to hashing function define($row['cfgKey'], $row['cfgValue']); } replace with: while ($row = @mysql_fetch_array($result)) { //bof added to prevent errors $config_values = ""; // eof added to prevent errors if ($row['cfgKey'] != "LAST_HASH") $config_values.=$row['cfgKey'].'='.$row['cfgValue']; //to be fed to hashing function define($row['cfgKey'], $row['cfgValue']); } //bof added to prevent errors $page = ""; $thumbnail_size = ""; $frame = ""; $bevel = ""; $image_watermark = ""; $text_watermark = ""; $line = ""; $page_prefix = ""; //eof added to prevent errors 1054 Error1054 - Unknown column 'p.products_id' in 'on clause'select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials_retail_prices s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '2'" Basically, this is an issue with left join lists - and fixing involves finding all left join lists and adding bracket's in the right places. This is explained quite well here: http://www.oscommerce.com/forums/topic/335136-osc-and-mysql-5-1054-errors/. So far, I have replaced index.php, admin/stats_products_viewed, admin/includes/classes/PriceFormatter.php. I'm sure there will be more to fix, I will keep an eye out for errors as I go. 1052 Error1052 - Column 'products_id' in from clause is ambiguous select count(p.products_id) as total from (products p, products_description pd, manufacturers m, products_to_categories p2c) left join specials_retail_prices s using(products_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '15' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = … I don't understand this error, but found the solution on the forum: find the following in index.php $listing_sql = "select " . $select_column_list . " p.products_id, p.products_stars, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " .TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS_RETAIL_PRICES . " s using(products_id) where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$_GET['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; and replace the using(products_id) with p.products_id = s.products_id. Options issueDirectory index forbidden by Options directive: /images/, referer: /index.php?cPath=26 No idea why this error was happening, instead of displaying an image for the category, it wasn't displaying anything, and was throwing the above error in the error_log. I didn't need/want the image there anyway, so I opened index.php and deleted the reference to the image:replace <?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?> and <?php echo tep_image(DIR_WS_IMAGES . $image, $category['categories_htc_title_tag'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?> with <br /> (appears 3 times all up in index.php, in my version). Shipping Estimator contributionPHP Parse error: syntax error, unexpected $end in /includes/modules/shipping_estimator.php on line 356, referer: /product_info.php Open the file and replace all <? with <?php. eWay contributionCrazy pages of texts when clicking on "modules" on the admin side Open all files to do with eWay (all files in "ewaypayment" folder as well as includes/modules/payment/eWayPayment.php and includes/languages/english/modules/payment/eWayPayment.php) and replace all <? with <?php. Frequently Asked Questions (FAQ) contribution0) { while (list($key, $val) = each($data)) { $no % 2 ? $bgcolor="#DEE4E8" : $bgcolor="#F0F1F1"; ?>Open admin/faq_list.php and replace all <? with <?php. Gift Voucher contributionOpen checkout_payment.php and replace all <? with <?php. Statistic Search Keywords contribution'; ?> ';? ' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . " : . tep_image_button('button_reset.gif', IMAGE_RESET) . " ). ' ' . tepee_image_button('button_search.gif', IMAGE_SHOW_SEARCH_RESULT) . "; ?> Open admin/stats_keywords.php and replace <?= with <?php echo (note the space at the end of "echo") and replace <? with <?php Printable Catalog & STS combo contributionFATAL ERROR: register_globals is disabled in php.ini, please enable it!Open includes/application_top1.php and comment out lines referring to register_globals:// check if register_globals is enabled.// since this is a temporary measure this message is hardcoded. The requirement will be removed before 2.2 is finalized.// if (function_exists('ini_get')) {// ini_get('register_globals') or exit('FATAL ERROR: register_globals is disabled in php.ini, please enable it!');// } Fix 1054 left join errors as per above instructions. Sorting options not workingThis appears to be a register_globals issue - to fix, find switch ($listing) { and replace with switch ($_GET['listing']) { in catalog_products_with_images.php Email ValidationYour E-Mail Address does not appear to be valid - please make any necessary correctionsSomehow it appears that an internet connection is needed to validate the email address, so my site was throwing the above error when I was testing my site on my local server, when I had no internet connection. This has nothing to do with moving servers or php/mysql versions, but it was an error I encountered due to setting up a local testing server, so I thought it was worth mentioning. Errors that I'm still having: My manufacturers search on the main page is not working (can't find a fix, am dropping the manufacturers search for now). Will continue to try and fix this. Printable Catalog is still not completely working - the page links at the bottom of the page aren't working. There are a few people on the forum that are having this issue, however there doesn't seem to be a solution as of yet. For now, I'm having to take out the link for the printable catalog, will continue to try and fix this. PHP Warning: mysql_num_rows() expects parameter 1 to be resource, null given in /includes/functions/database.php on line 132 I just have no idea why this is happening, and nothing seems to be happening because of it. I'll update this thread with any other errors that I have as a result of the move. If I've described how to do something incorrectly, please let me know - despite the amount of work I've done on my site, I'm still a true novice at all of this! This is as much a reference to me as it is to anyone else. Thanks to all that helped me find the solutions and put up with my questions :)
motorcity Posted March 7, 2011 Posted March 7, 2011 Very nice of you to post all this. Good info. I had my admin/customers.php set up with a selectable listing like lastname but particularly I found listing by account created. The error I'm working on is Error: Undefined variable: listing File: customers.php Line: 709 line 709 switch ($listing)
♥geoffreywalton Posted March 7, 2011 Posted March 7, 2011 Try going to my about me and search for upgrades. There is a link to a contribution by Jan that covers all the changes required. HTH G Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile Virus Threat Scanner My Contributions Basic install answers. Click here for Contributions / Add Ons. UK your site. Site Move. Basic design info. For links mentioned in old answers that are no longer here follow this link Useful Threads. If this post was useful, click the Like This button over there ======>>>>>.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.