bluechip Posted December 28, 2004 Posted December 28, 2004 Hi all, i have a fresh install and the catalog works and looks good but when i try to access the admin tool i am getting the following error Parse error: parse error, unexpected '(', expecting ',' or ';' in /usr/local/www/data-dist/catalog/admin/includes/classes/sessions.php on line 33 here is the code around line 33 of sessions.php var $use_cookies = true; var $cookie_lifetime = 0; line 33 var $cookie_path = substr(DIR_WS_ADMIN, 0, -1); var $cookie_domain = ''; any help would be greatly appreciated Brian
Guest Posted December 28, 2004 Posted December 28, 2004 Hi all,i have a fresh install and the catalog works and looks good but when i try to access the admin tool i am getting the following error Parse error: parse error, unexpected '(', expecting ',' or ';' in /usr/local/www/data-dist/catalog/admin/includes/classes/sessions.php on line 33 here is the code around line 33 of sessions.php var $use_cookies = true; var $cookie_lifetime = 0; line 33 var $cookie_path = substr(DIR_WS_ADMIN, 0, -1); var $cookie_domain = ''; any help would be greatly appreciated Brian <{POST_SNAPBACK}> That code matches mine exactly. The problem must be on another line (probably higher up).
bluechip Posted December 28, 2004 Author Posted December 28, 2004 That code matches mine exactly. The problem must be on another line (probably higher up). <{POST_SNAPBACK}> here is the rest, from the top atleast <?php /* $Id: sessions.php,v 1.11 2003/06/20 16:23:08 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License Original source from Web Application Development with PHP (Tobias Ratschiller, Till Gerken) Copyright © 2000, New Riders Publishing */ $SID = ''; class php3session { var $name = PHP_SESSION_NAME; var $auto_start = false; var $referer_check = false; var $save_path = PHP_SESSION_SAVE_PATH; var $save_handler = 'php3session_files'; var $lifetime = 0; var $cache_limiter = 'nocache'; var $cache_expire = 180; var $use_cookies = true; var $cookie_lifetime = 0; var $cookie_path = substr(DIR_WS_ADMIN, 0, -1); line 34 var $cookie_domain = '';
bluechip Posted December 29, 2004 Author Posted December 29, 2004 That all matches too. Hmmm. <{POST_SNAPBACK}> could this be a php version mismatch?? i am running 4.3.9
♥Vger Posted December 29, 2004 Posted December 29, 2004 4.3.9 is fine for running osCommerce (except that it is no longer secure and needs upgrading), and there is (apparently) nothing wrong with that code. However, have you edited this file in something other than a plain text editor e.g. FrontPage, WordPad, Word etc? If so there may be some hidden text formatting that's crept in somewhere. Vger
bluechip Posted December 29, 2004 Author Posted December 29, 2004 4.3.9 is fine for running osCommerce (except that it is no longer secure and needs upgrading), and there is (apparently) nothing wrong with that code. However, have you edited this file in something other than a plain text editor e.g. FrontPage, WordPad, Word etc? If so there may be some hidden text formatting that's crept in somewhere. Vger <{POST_SNAPBACK}> only been edited in vi
alchemywd Posted December 29, 2004 Posted December 29, 2004 only been edited in vi <{POST_SNAPBACK}> I had that same error, i ended up redoing the whole store... ========= Thanks, William.
♥Vger Posted December 29, 2004 Posted December 29, 2004 only been edited in vi Personally, I'd download it via FTP and take a look at it in Notepad or another plain text editor. Sometimes when you're saving in vi errors can creep in, especially white space. Vger
bluechip Posted December 29, 2004 Author Posted December 29, 2004 Personally, I'd download it via FTP and take a look at it in Notepad or another plain text editor. Sometimes when you're saving in vi errors can creep in, especially white space. Vger <{POST_SNAPBACK}> i tried a fresh install on a suse 9.1 box that i downloaded from one of the source forge sites and I get the exact same error. I am new to php and have absolutely no idea where to look for the problem. Any more ideas? do i need to post my configure.php file? Help please
OceanRanch Posted December 29, 2004 Posted December 29, 2004 Post your admin/includes/configure.php minus the user/password. Since the error is pointing at the define DIR_WS_ADMIN it might be something in the configure.php that isn't correct. HTH Tom
bluechip Posted December 29, 2004 Author Posted December 29, 2004 Post your admin/includes/configure.php minus the user/password. Since the error is pointing at the define DIR_WS_ADMIN it might be something in the configure.php that isn't correct. HTH Tom <{POST_SNAPBACK}> ok here is my admin/includes/configure.php file <?php /* osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ // Define the webserver and path parameters // * DIR_FS_* = Filesystem directories (local/physical) // * DIR_WS_* = Webserver directories (virtual/URL) define('HTTP_SERVER', 'http://ec.bccs.com'); // eg, http://localhost - should not be empty for productive servers define('HTTP_CATALOG_SERVER', 'http://ec.bccs.com'); define('HTTPS_CATALOG_SERVER', 'https://ec.bccs.com'); define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module define('DIR_FS_DOCUMENT_ROOT', '/usr/local/www/data/catalog/'); // where the pages are located on the server define('DIR_WS_ADMIN', '/catalog/admin/'); // absolute path required define('DIR_FS_ADMIN', '/usr/local/www/data/catalog/admin/'); // absolute pate required define('DIR_WS_CATALOG', '/catalog/'); // absolute path required define('DIR_FS_CATALOG', '/usr/local/www/data/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', 'ec.bccs.com'); // eg, localhost - should not be empty for productive servers define('DB_SERVER_USERNAME', '****'); define('DB_SERVER_PASSWORD', '************'); define('DB_DATABASE', 'ecom'); define('USE_PCONNECT', 'false'); // use persisstent connections? define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql' ?>
Guest Posted December 29, 2004 Posted December 29, 2004 ok here is my admin/includes/configure.php file <?php /* osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Released under the GNU General Public License */ // Define the webserver and path parameters // * DIR_FS_* = Filesystem directories (local/physical) // * DIR_WS_* = Webserver directories (virtual/URL) define('HTTP_SERVER', 'http://ec.bccs.com'); // eg, http://localhost - should not be empty for productive servers define('HTTP_CATALOG_SERVER', 'http://ec.bccs.com'); define('HTTPS_CATALOG_SERVER', 'https://ec.bccs.com'); define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module define('DIR_FS_DOCUMENT_ROOT', '/usr/local/www/data/catalog/'); // where the pages are located on the server define('DIR_WS_ADMIN', '/catalog/admin/'); // absolute path required define('DIR_FS_ADMIN', '/usr/local/www/data/catalog/admin/'); // absolute pate required define('DIR_WS_CATALOG', '/catalog/'); // absolute path required define('DIR_FS_CATALOG', '/usr/local/www/data/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', 'ec.bccs.com'); // eg, localhost - should not be empty for productive servers define('DB_SERVER_USERNAME', '****'); define('DB_SERVER_PASSWORD', '************'); define('DB_DATABASE', 'ecom'); define('USE_PCONNECT', 'false'); // use persisstent connections? define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql' ?> <{POST_SNAPBACK}> That all matches mine exactly.
OceanRanch Posted December 29, 2004 Posted December 29, 2004 The only thing I can see is that // Define the webserver and path parameters // * DIR_FS_* = Filesystem directories (local/physical) // * DIR_WS_* = Webserver directories (virtual/URL) appears to be missing some "newlines". If your under UNIX/LINUX you can run a command "od -c configure.php" which will show you any strange characters and also show you all the newlines and carriage returns (white space). The configue.php may not be the problem, but I'd try with a fresh copy on my PC, make the appropriate changes, then make sure to ftp in ascii mode to your UNIX server. Tom
bluechip Posted December 29, 2004 Author Posted December 29, 2004 The only thing I can see is that // Define the webserver and path parameters // * DIR_FS_* = Filesystem directories (local/physical) // * DIR_WS_* = Webserver directories (virtual/URL) appears to be missing some "newlines". If your under UNIX/LINUX you can run a command "od -c configure.php" which will show you any strange characters and also show you all the newlines and carriage returns (white space). The configue.php may not be the problem, but I'd try with a fresh copy on my PC, make the appropriate changes, then make sure to ftp in ascii mode to your UNIX server. Tom <{POST_SNAPBACK}> i understand what you are saying except im doing no changes on a pc. I loaded the install on my unix box from osc and from sourceforge. all editing to files was done in vi on the unix machine. the only time those files touch a pc is when i email them to myself to post here. so im not sure how anything on the file on the actual unix machine sould have white space problems?
OceanRanch Posted December 29, 2004 Posted December 29, 2004 Well get out your degugging hat. I'd write a small php program that "includes" the configure.php file and then echo out the define that appears not be working.
bluechip Posted December 29, 2004 Author Posted December 29, 2004 Well get out your degugging hat. I'd write a small php program that "includes" the configure.php file and then echo out the define that appears not be working. <{POST_SNAPBACK}> not a php programmer but would be willing to pay
OceanRanch Posted December 29, 2004 Posted December 29, 2004 I'm off and running now and wouldn't think of charging you, but I don't have any time now. It's a simple script to isolate the problem. Maybe some else can jump in and help Brian out here. Tom
Recommended Posts
Archived
This topic is now archived and is closed to further replies.