peterp Posted February 3 Share Posted February 3 Hi All, I have just downloaded from a server which is a working version of cubecart ver 6.5.1 to a local host so that we can do some modifications without upsetting the production version, how ever when we try to run this on our local host we just get a blank screen and nothing else. I have checked the global.inc.php and all seems ok, Any suggestions will be appreciated. Best Regards, Peterp Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 3 Share Posted February 3 Not being able to get into the admin also means not being able to view the System Error Log. So, please use a database utility program to access the local database (or whichever database the local CubeCart installation is communicating with), and view the CubeCart_system_error_log table. There should be records with what went wrong -- unless what went wrong happens before the Database connection happens. Quote Link to comment Share on other sites More sharing options...
peterp Posted February 3 Author Share Posted February 3 Hi Brian, Happy New Year I have included the last couple of lines from system error log, I tried to include a pdf of the screen but for some reason it kept failing, hope this is helpful Best Regards, Peterp [<strong>Warning</strong>] C:xampphtdocschampcocl... https://localhost/champcoclothingtestnew/admin_ZlX... __construct() (dashboard.index.inc.php:434) includ... [<strong>Warning</strong>] C:xampphtdocschampcocl... https://localhost/champcoclothingtestnew/admin_ZlX... __construct() (dashboard.index.inc.php:434) includ... [<strong>Warning</strong>] C:xampphtdocschampcocl... https://localhost/champcoclothingtestnew/admin_ZlX... __construct() (dashboard.index.inc.php:434) includ... Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 3 Share Posted February 3 There isn't enough of the first column's contents, nor the third column's contents. The second column's contents may be useful, but maybe not. I see that you are using 'localhost' as the domain name. I would recommend doing the following, In the file /includes/global.inc.php, add these statements, replacing any that mention 'localhost': $glob['storeURL'] = 'http://127.0.0.1/champcoclothingtestnew'; $glob['standard_url'] = 'http://127.0.0.1/champcoclothingtestnew'; $glob['cookie_domain'] = '127.0.0.1'; I also see that the web address is using 'https'. This will not work on 'localhost', unless you actually have a weirdly-configured self-signed certificate. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 3 Share Posted February 3 I've been reading up on XAMPP and SSL for 'localhost'. Seems it can be done. XAMPP has a script to generate a self-signed cert. Quote Link to comment Share on other sites More sharing options...
peterp Posted February 4 Author Share Posted February 4 Hi Brian, I tried to attach a image but unfortunately it just keeps on saying it has an error 200, am I doing something wrong. Therefore I cannot show you what the fields are saying in the system error log. Best Regards, Peterp Hi Brian, I have copied and paste the fields from the system error log Message [<strong>Notice</strong>] C:xampphtdocschampcoclothingtestnewcacheskinfe21b8e9276dbbc3e953e1f00db9a3a73b643126_0.file.common.search.php.php:62 - Trying to get property 'value' of non-object URL https://localhost/champcoclothingtestnew/admin_ZlX9zy.php?_g=plugins backtrace handleError() (fe21b8e9276dbbc3e953e1f00db9a3a73b643126_0.file.common.search.php.php:62) content_65026c6eda81d7_17997555() (smarty_template_resource_base.php:123) getRenderedTemplateCode() (smarty_template_compiled.php:114) render() (smarty_internal_template.php:217) render() (smarty_internal_template.php:386) _subTemplateRender() (7dd6440dc54dab53fa3a314ab421b7eafc15e328_0.file.main.php.php:126) content_65026c6ec69ce2_43707777() (smarty_template_resource_base.php:123) getRenderedTemplateCode() (smarty_template_compiled.php:114) render() (smarty_internal_template.php:217) render() (smarty_internal_templatebase.php:238) _execute() (smarty_internal_templatebase.php:116) fetch() (gui.class.php:342) display() (admin_ZlX9zy.php:54) Hope this is helpful Best Regards, Peterp Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 4 Share Posted February 4 (edited) This is a Notice and will not cause a blank page. This error is coming from a PHP script that is the compiled skin template, "common.search.php". At the bottom of the template file, there is a foreach loop that will paste additional search forms to the slide-out panel currently showing text entry boxes for items to search for. The array $SIDEBAR_CONTENT will need to be assigned from plugins having custom content - I cannot find in the core code where custom content gets assigned to 'SIDEBAR_CONTENT'. That foreach loop used to be wrapped in a {if isset($SIDEBAR_CONTENT)} condition, but was removed as being unnecessary in CC6.1.11. Look for a database table entry showing 'Exception'. Edited February 4 by bsmither Quote Link to comment Share on other sites More sharing options...
peterp Posted February 4 Author Share Posted February 4 Hi Brian, I think the reason its trying to use the SSL(https//) is because the SSL certificate is set to yes on the production site and this version was a direct copy of the production programs that we are trying to use for testing reasons. Best Regards, Peterp Hi Brian, I have looked in the system error log for any exceptions but are none, should I be looking in some other table. I have tried to attach a file and image but I just get the message that the upload has failed with an error 200, its not my day Best Regards Peterp Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 4 Share Posted February 4 If that is the case, that config setting is stored in the database table CubeCart_config, the row named 'config'. You might be able to override this by adding the following to /includes/global.inc.php: $glob['ssl'] = 0; Quote Link to comment Share on other sites More sharing options...
peterp Posted February 4 Author Share Posted February 4 Hi Brian, I made that change to the global.inc.php and then tried to run cubecart again but unfortunately the same result however when I looked at the system errorlog table I noticed it was different see below [<strong>Notice</strong>] C:xampphtdocschampcoclothingtestnewcacheskinfe21b8e9276dbbc3e953e1f00db9a3a73b643126_0.file.common.search.php.php:62 - Trying to get property 'value' of non-object https://localhost/champcoclothingtestnew/admin_ZlX9zy.php?_g=plugins handleError() (fe21b8e9276dbbc3e953e1f00db9a3a73b643126_0.file.common.search.php.php:62) content_65026c6eda81d7_17997555() (smarty_template_resource_base.php:123) getRenderedTemplateCode() (smarty_template_compiled.php:114) render() (smarty_internal_template.php:217) render() (smarty_internal_template.php:386) _subTemplateRender() (7dd6440dc54dab53fa3a314ab421b7eafc15e328_0.file.main.php.php:126) content_65026c6ec69ce2_43707777() (smarty_template_resource_base.php:123) getRenderedTemplateCode() (smarty_template_compiled.php:114) render() (smarty_internal_template.php:217) render() (smarty_internal_templatebase.php:238) _execute() (smarty_internal_templatebase.php:116) fetch() (gui.class.php:342) display() (admin_ZlX9zy.php:54) Is this of any help Regards, Peter Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 4 Share Posted February 4 How is the above different than what was posted earlier? According to that error message, the Manage Extensions is what is being asked to show. This implies to me that you are logging in to admin, then clicking the Manage Extensions link in the Navigation pane. If you are not finding an "Exception" logged in CubeCart_system_error_log, look for PHP's error log. It will help to read this: https://forums.cubecart.com/topic/51550-how-to-create-the-error-log/ Quote Link to comment Share on other sites More sharing options...
peterp Posted February 4 Author Share Posted February 4 Hi Brian, I may have not explained what was happening initially and that i that when I type in the URL" http://champcoclothingtestnew/admin_ZlX9zy.php", I don't even get a login screen it just displays a blank screen, so I don't get any navigation screen at all so I'm not able to select anything. Sorry if I wasn't clear about what was happening. Best Regards, Peterp Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 5 Share Posted February 5 I thought that be the case, but the error log entry posted above says that the error occurred trying to get to ?_g=plugins. Let's see what the error_log has in it. Quote Link to comment Share on other sites More sharing options...
peterp Posted February 5 Author Share Posted February 5 Hi Brian, I have setup the error log and run cubecart again then printed the error log as below: [05-Feb-2024 00:36:00 UTC] PHP Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'peterp'@'localhost' (using password: YES) in C:\xampp\htdocs\champcoclothingtestnew\classes\db\mysqli.class.php:37 Stack trace: #0 C:\xampp\htdocs\champcoclothingtestnew\classes\db\mysqli.class.php(37): mysqli->__construct('localhost', 'peterp', Object(SensitiveParameterValue), 'champcoclothing...', '3306', '') #1 C:\xampp\htdocs\champcoclothingtestnew\classes\db\mysqli.class.php(64): Database->__construct(Array) #2 C:\xampp\htdocs\champcoclothingtestnew\controllers\controller.admin.pre_session.inc.php(21): Database::getInstance(Array) #3 C:\xampp\htdocs\champcoclothingtestnew\admin_ZlX9zy.php(34): include('C:\\xampp\\htdocs...') #4 {main} thrown in C:\xampp\htdocs\champcoclothingtestnew\classes\db\mysqli.class.php on line 37 Best Regards, Peterp Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 5 Share Posted February 5 Good. Getting somewhere. According to the info in /includes/global.inc.php, review where your database is at and the username and password to access it. Let us assume that your username and password is correct. That leaves accessing the database using 'localhost' is being tried, but the database is not aware of any user having the name 'peterp' trying to access it by 'localhost'. In my experience, 'localhost' is different than '127.0.0.1', which is different than using any other IP address. (One can also use '*' to permit 'peterp' to access the database from any manner: localhost, IP address, unix sockets, whatever.) Somehow, you will need to look at the database and access the list of users it knows about for that database. Does the info in global.inc.php suggest that CubeCart is trying to communicate with the database located on the production server? If so, that database is not local to the development environment. If the target database is on the local development environment, then there must be a user created on that database named 'peterp'. What program do you use to access the database on the development environment -- assuming this is the database you are reading the records from CubeCart_system_error_log? Quote Link to comment Share on other sites More sharing options...
peterp Posted February 5 Author Share Posted February 5 Hi Brian, You will be happy to know that I went into the users within XAMPP and deleted peterp and then created the user again and this seems to have fixed the issue. I can now get a login screen which allows me to login and get to the admin screen. Hooray! However when I go to the actual store I can get the main front page but when I try to select something I get the home page for XAMPP. The information I'm accessing on the development system is completely isolated from the production database. I have check global.inc and it is pointing to the correct database on the development server which is completely local Does this have anything to do with what we have been doing Best Regards, Peterp Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 5 Share Posted February 5 (edited) Ok. CubeCart (as of several versions now) will show the index.php page whenever there is a file not found (404 response). You can see this at the end of the .htaccess file in CubeCart's main folder. What is probably missing is either a directive in .htaccess to load and use the mod_rewrite extension, or there is a misconfigured web server configuration statement that allows .htaccess directives to override directives in the main config file. So, verify that the .htaccess file has the following directives: ### Rewrite rules for SEO functionality ### <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / Then research the Apache documentation to learn about AllowOverride All. The SEO rewrites are necessary because friendly web addresses, such as www.example.com/friendly-name-of-product does not exist and the web server will issue a 404 -- but then the 404 directive in .htaccess tells the web server to send a page anyway -- ErrorDocument 404 /index.php. The rewrite puts the friendly web address into a format that CubeCart actually uses. If there is still a problem, you may have to edit the RewriteBase statement as: RewriteBase /champcoclothingtestnew/ Otherwise, the rewrite may erroneously include the subdirectory as part of the friendly web address. Edited February 5 by bsmither Quote Link to comment Share on other sites More sharing options...
peterp Posted February 6 Author Share Posted February 6 Hi Brian, Thanks so much this has fixed this issue i had to add the path name in the rewrite statement it then worked Your help is very much appreciated Best Regards, Peterp Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.