Guest Posted March 2, 2008 Posted March 2, 2008 Dear fellow Oscommerce users, Allthough I have read many topics about this error, no matter what I try nothing works. My error is: Parse error: syntax error, unexpected '/' in C:\xampp\htdocs\catalog\includes\functions\database.php on line 17 No matter what I do or change (even delete line 15,16,17,18 etc... in database.php) this error keeps popping up. My admin console works perfectly and I can change whatever I want. But if I want to view my the results..nope the above error pops up. It must have something to do with my two config files but I am to blind to see after 7h, what may cause the error. Can somebody look at this with a pair of fresh eyes? The site is hosted on a lcal server using Apache. I did not choose a password to log into the database. my Catalog/admin/includes.config file: define('HTTP_SERVER', 'http://127.0.0.1'); // eg, http://localhost - should not be empty for productive servers define('HTTP_CATALOG_SERVER', 'http://127.0.0.1'); define('HTTPS_CATALOG_SERVER', ''); define('ENABLE_SSL_CATALOG', 'false'); // secure webserver for catalog module define('DIR_FS_DOCUMENT_ROOT', 'C:/xampp/htdocs/catalog/'); // where the pages are located on the server define('DIR_WS_ADMIN', '/catalog/admin/'); // absolute path required define('DIR_FS_ADMIN', 'C:/xampp/htdocs/catalog/admin/'); // absolute pate required define('DIR_WS_CATALOG', '/catalog/'); // absolute path required define('DIR_FS_CATALOG', 'C:/xampp/htdocs/catalog/'); // absolute path required 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 . 'backups/'); // define our database connection define('DB_SERVER', '127.0.0.1'); // eg, localhost - should not be empty for productive servers define('DB_SERVER_USERNAME', 'root'); define('DB_SERVER_PASSWORD', ''); define('DB_DATABASE', 'oscommerce'); define('USE_PCONNECT', 'false'); // use persisstent connections? define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'?> My Catalog/includes/config file: define('HTTP_SERVER', 'http://127.0.0.1'); // eg, http://localhost - should not be empty for productive servers define('HTTPS_SERVER', ''); // eg, https://localhost - should not be empty for productive servers define('ENABLE_SSL', false); // secure webserver for checkout procedure? define('HTTP_COOKIE_DOMAIN', '127.0.0.1'); define('HTTPS_COOKIE_DOMAIN', ''); define('HTTP_COOKIE_PATH', '/catalog/'); define('HTTPS_COOKIE_PATH', ''); define('DIR_WS_HTTP_CATALOG', '/catalog/'); define('DIR_WS_HTTPS_CATALOG', ''); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); 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_DOWNLOAD_PUBLIC', 'pub/'); define('DIR_FS_CATALOG', 'C:/xampp/htdocs/catalog/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/'); define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/'); // define our database connection define('DB_SERVER', '127.0.0.1'); // eg, localhost - should not be empty for productive servers define('DB_SERVER_USERNAME', 'root'); define('DB_SERVER_PASSWORD', ''); define('DB_DATABASE', 'oscommerce'); define('USE_PCONNECT', 'false'); // use persistent connections? define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'?> I am hoping that there is anybody out there who can point me to the right direction and advise me of ,most probably, a silly mistake. Greetings, Robert
burt Posted March 2, 2008 Posted March 2, 2008 If you are on localhost, I think your paths should have backslashes, eg; C:\xampp\htdocs\catalog\
Guest Posted March 2, 2008 Posted March 2, 2008 If you are on localhost, I think your paths should have backslashes, eg; C:\xampp\htdocs\catalog\ Hi Burt, Thanks for the quick reaction. Tried that already, but then even more errors pop up.. as example: Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\catalog\includes\configure.php on line 34 etc...
♥FWR Media Posted March 2, 2008 Posted March 2, 2008 What's the red bit all about then? define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'?> Perhaps you close again at the end? But it still looks to me like it must be in database.php Paste the first 30 lines Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Guest Posted March 2, 2008 Posted March 2, 2008 What's the red bit all about then? define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'?> Hi Robert, As far as I know, but I am no Oscommerce pro, this red thingie is on every page. I think it closes the page? But that is just an educated guess, because its in every php file.
♥FWR Media Posted March 2, 2008 Posted March 2, 2008 Hi Robert, As far as I know, but I am no Oscommerce pro, this red thingie is on every page. I think it closes the page? But that is just an educated guess, because its in every php file. LOL I know .. it's in the wrong place though. I edited the above. Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Guest Posted March 2, 2008 Posted March 2, 2008 LOL I know .. it's in the wrong place though. I edited the above. Robert, Here they are, the first 30 lines from database.php <?php /* $Id: database.php,v 1.23 2003/06/20 00:18:30 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') { global $$link; if ($$link) mysql_select_db($database); if (USE_PCONNECT == 'false') { $$link = mysql_pconnect($server, $username, $password); } else { $$link = mysql_connect($server, $username, $password); } return $$link; } function tep_db_close($link = 'db_link') { global $$link; return mysql_close($$link); }
♥FWR Media Posted March 2, 2008 Posted March 2, 2008 I don't suppose you have a / in the username or password do you? Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Guest Posted March 2, 2008 Posted March 2, 2008 I don't suppose you have a / in the username or password do you? I only use a user name..No password.. Already tried that too, to fill out only the username..which is supposed to be 'root'. But that didn't work out too..
♥FWR Media Posted March 2, 2008 Posted March 2, 2008 I only use a user name..No password.. Already tried that too, to fill out only the username..which is supposed to be 'root'. But that didn't work out too.. You have tried uploading a fresh catalog/includes/functions/database.php in case your local one became corrupted? Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
♥FWR Media Posted March 2, 2008 Posted March 2, 2008 Try copying and pasting the following into catalog/includes/configure.php define('DIR_FS_CATALOG', 'C:\xampp\htdocs\catalog\\'); // absolute path required Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Guest Posted March 2, 2008 Posted March 2, 2008 You have tried uploading a fresh catalog/includes/functions/database.php in case your local one became corrupted? Yep, My whole site is backed up several times indeed..I case I was messing up things. I know myself.. I have been digging all day..pfew..it all should have been so easy..I thought..
Guest Posted March 2, 2008 Posted March 2, 2008 Try copying and pasting the following into catalog/includes/configure.php define('DIR_FS_CATALOG', 'C:\xampp\htdocs\catalog\\'); // absolute path required And without succes.. just in case..I do delete my previous history everytime before I reload..
♥FWR Media Posted March 2, 2008 Posted March 2, 2008 Odd .. there's something wrong in your code somewhere that's for sure. Ok Parse error: syntax error, unexpected '/' in C:\xampp\htdocs\catalog\includes\functions\database.php on line 17 Exactly when/where do you get this? Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Guest Posted March 2, 2008 Posted March 2, 2008 Odd .. there's something wrong in your code somewhere that's for sure. Ok Parse error: syntax error, unexpected '/' in C:\xampp\htdocs\catalog\includes\functions\database.php on line 17 Exactly when/where do you get this? When I open: http://127.0.0.1/catalog/ The only thing I see is that error.
♥FWR Media Posted March 2, 2008 Posted March 2, 2008 Well something must be missing in your explanation. Line 17 is a blank line in the example you post. Are you sure you are not showing us catalog/admin/includes/functions/database.php because other than this I can't help. Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Guest Posted March 2, 2008 Posted March 2, 2008 Well something must be missing in your explanation. Line 17 is a blank line in the example you post. Are you sure you are not showing us catalog/admin/includes/functions/database.php because other than this I can't help. Hi Robert, I know..but if need be I can send printscreens of all the misery I see on my screen..Its really incredible..No matter what I check.. That error msg..comes out of a dark place....Because I even tried to delete line 13 until 20..and even without all that text..it keeps on mentioning the same error.. ain't this nice..pfff once more my database.php <?php /* $Id: database.php,v 1.23 2003/06/20 00:18:30 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') { global $$link; if ($$link) mysql_select_db($database); if (USE_PCONNECT == 'true') { $$link = mysql_pconnect($server, $username, $password); } else { $$link = mysql_connect($server, $username, $password); } return $$link; } function tep_db_close($link = 'db_link') { global $$link; return mysql_close($$link); } function tep_db_error($query, $errno, $error) { die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>'); } function tep_db_query($query, $link = 'db_link') { global $$link, $logger; if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) { if (!is_object($logger)) $logger = new logger; $logger->write($query, 'QUERY'); } $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error()); if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) { if (mysql_error()) $logger->write(mysql_error(), 'ERROR'); } return $result; } function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') { reset($data); if ($action == 'insert') { $query = 'insert into ' . $table . ' ('; while (list($columns, ) = each($data)) { $query .= $columns . ', '; } $query = substr($query, 0, -2) . ') values ('; reset($data); while (list(, $value) = each($data)) { switch ((string)$value) { case 'now()': $query .= 'now(), '; break; case 'null': $query .= 'null, '; break; default: $query .= '\'' . tep_db_input($value) . '\', '; break; } } $query = substr($query, 0, -2) . ')'; } elseif ($action == 'update') { $query = 'update ' . $table . ' set '; while (list($columns, $value) = each($data)) { switch ((string)$value) { case 'now()': $query .= $columns . ' = now(), '; break; case 'null': $query .= $columns .= ' = null, '; break; default: $query .= $columns . ' = \'' . tep_db_input($value) . '\', '; break; } } $query = substr($query, 0, -2) . ' where ' . $parameters; } return tep_db_query($query, $link); } function tep_db_fetch_array($db_query) { return mysql_fetch_array($db_query, MYSQL_ASSOC); } function tep_db_result($result, $row, $field = '') { return mysql_result($result, $row, $field); } function tep_db_num_rows($db_query) { return mysql_num_rows($db_query); } function tep_db_data_seek($db_query, $row_number) { return mysql_data_seek($db_query, $row_number); } function tep_db_insert_id() { return mysql_insert_id(); } function tep_db_free_result($db_query) { return mysql_free_result($db_query); } function tep_db_fetch_fields($db_query) { return mysql_fetch_field($db_query); } function tep_db_output($string) { return htmlspecialchars($string); } function tep_db_input($string, $link = 'db_link') { global $$link; if (function_exists('mysql_real_escape_string')) { return mysql_real_escape_string($string, $$link); } elseif (function_exists('mysql_escape_string')) { return mysql_escape_string($string); } return addslashes($string); } function tep_db_prepare_input($string) { if (is_string($string)) { return trim(stripslashes($string)); } elseif (is_array($string)) { reset($string); while (list($key, $value) = each($string)) { $string[$key] = tep_db_prepare_input($value); } return $string; } else { return $string; } } ?>
Guest Posted March 2, 2008 Posted March 2, 2008 Well something must be missing in your explanation. Line 17 is a blank line in the example you post. Are you sure you are not showing us catalog/admin/includes/functions/database.php because other than this I can't help. Should I try another Oscommerce site? I have several to test.. Think its better if I just start all over again..to see where I end up .. Thanks for all your help, really appreciated!!
♥FWR Media Posted March 2, 2008 Posted March 2, 2008 Should I try another Oscommerce site? I have several to test.. Think its better if I just start all over again..to see where I end up .. Thanks for all your help, really appreciated!! Sure .. make sure you are using a decent text editor and ftp prog. E.g. not dreamweaver etc. Ftp recommend .. filezilla (free google it) text edit recommend ConTEXT (free google it) Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.