Jump to content
dianepep

Product Reviews Not Showing

Recommended Posts

17 hours ago, bsmither said:

PHP is fairly reliable about getting its errors logged. There are two instances where I can guess why a log file is not getting created:

1. The hosting provider has somehow managed to really lock down the INI setting for where to log errors.
2. The SMARTY template rendering engine also gets tied into PHP's error reporting sub-system. If there were an issue with rendering a template, that has been known to cause a blank screen with absolutely no errors getting reported. That's not so much an issue anymore with the latest versions of CubeCart.

(I saw your reply in the "How to..." conversation.)

Update on my reviews table: I was able to successfully copy over all reviews. I guess I just messed up something the first time. I am new to phpmyadmin and sql so I researched a bit and gave myself a quick lesson in both.

I am now getting an error when I try to do anything in Admin Panel. The error says: 

This page isn’t working

ilovemybigbooty.com is currently unable to handle this request.

HTTP ERROR 500
 
I read another post from someone getting this error and you advised them to check Php Info for mbstring Multibyte support and mine says Enabled. I also have a message there is an update to Paypal Commerce so I attempted to update that in case that was causing the issue but I got the http error 500 trying to update that also. Could this be an issue with my hosting provider?

Share this post


Link to post
Share on other sites

If the web server is now sending back this "response code", either PHP is still crashing (and is now able to tell the web server something went wrong, and might even have logged what went wrong in error_log), or the web server itself is disagreeing with something that is coming in (the POST payload).

Your hosting account control panel should have a place to view web server's error log.

Share this post


Link to post
Share on other sites
Posted (edited)
4 hours ago, bsmither said:

If the web server is now sending back this "response code", either PHP is still crashing (and is now able to tell the web server something went wrong, and might even have logged what went wrong in error_log), or the web server itself is disagreeing with something that is coming in (the POST payload).

Your hosting account control panel should have a place to view web server's error log.

Thanks again. I followed the steps to create an error log but no log is showing so I've contacted my hosting provider and they are looking into it. I cannot even get the Admin Panel to appear now. it gives the 500 error as soon as I login.

Edited by dianepep

Share this post


Link to post
Share on other sites

The error-log just showed up and is showing errors in my database.class.php file on line 1009 which is this line:         $trace = debug_backtrace();   under Log Sql Errors Section.

The error states: PHP Fatal error:  Allowed memory size of 268435456 bytes exhausted (tried to allocate 64 bytes) in /homepages/1/d236694210/htdocs/clickandbuilds/cubecart/Ilovemybigbootyshop/classes/db/database.class.php on line 1009

Share this post


Link to post
Share on other sites

Ok, so we now know that the environment given to you for your site to run in has a memory limit of 256MB. This is not unreasonable.

On the other hand, there is something about what CubeCart is doing with your data (or images) that is gobbling up all of that 256MB. It's not likely to be textual data, probably you have images that exceed recommended size: 600x600 pixels at less than 350KB filesize.

(Too large of images is the only thing that has crossed my path that exhausts memory.)

The error in the error_log may be related to certain admin pages -- but no images are in play when simply trying to get to the admin dashboard.

In the ini-custom.inc.php file, change the memory_limit value to '512M' and see what that gets you.

If you have CubeCart's debug mode enabled, at the bottom of each page, there is a report of the Memory Peak Usage.

Share this post


Link to post
Share on other sites
15 hours ago, bsmither said:

Ok, so we now know that the environment given to you for your site to run in has a memory limit of 256MB. This is not unreasonable.

On the other hand, there is something about what CubeCart is doing with your data (or images) that is gobbling up all of that 256MB. It's not likely to be textual data, probably you have images that exceed recommended size: 600x600 pixels at less than 350KB filesize.

(Too large of images is the only thing that has crossed my path that exhausts memory.)

The error in the error_log may be related to certain admin pages -- but no images are in play when simply trying to get to the admin dashboard.

In the ini-custom.inc.php file, change the memory_limit value to '512M' and see what that gets you.

If you have CubeCart's debug mode enabled, at the bottom of each page, there is a report of the Memory Peak Usage.

I thought I made all images according to the recommendations but I will double check when I can get back into the Admin Panel. Everything should be exactly the same as my other store under Aprils-choice, even the same images and product. 

I modified the ini-custom.inc.php file from 256m to 512m but still am unable to log into the Admin Panel and still receiving the http 500 error. 

Share this post


Link to post
Share on other sites

Let's hope your hosting provider has some error logs.

Share this post


Link to post
Share on other sites

Visiting what I guess to be your site web address, I find that every "friendly" link shows me the homepage (for example, your 'privacy policy' link).

This tells me that you have either copied the whole main page's HTML in the "Store Offline" content and your store is offline, or there isn't any URL rewriting happening.

 

Share this post


Link to post
Share on other sites
17 minutes ago, bsmither said:

Visiting what I guess to be your site web address, I find that every "friendly" link shows me the homepage (for example, your 'privacy policy' link).

This tells me that you have either copied the whole main page's HTML in the "Store Offline" content and your store is offline, or there isn't any URL rewriting happening.

 

uh oh. that's not good. I had all those filled in and were working fine. This is a good reminder for me to switch hosting companies sometime soon. The support either has no clue what they are doing or they are rude and unhelpful. I called and they had no idea where to access error logs and said they had to escalate the issue and I will receive an email when the next team have a chance to look at it. That was last night and of course there has been no email yet. I will call them again tonight. The only email I received from them was an email stating they reset my files to two days ago to see if that helps with the issue. I have no idea what files they reset or how much of my work they undid by this. I do not recommend 1 & 1  inois to anyone. 

Share this post


Link to post
Share on other sites

I just noticed in the error log for my latest attempt to access the Admin Panel, it says "Allowed memory size of 268435456 bytes exhausted" so the change I made to ini-custom.inc.php file did not increase the allowed memory. Should I try placing the memory limit in htaccess file instead?

Share this post


Link to post
Share on other sites

Setting the memory limit, if it didn't work in the script, then it won't work in the .htaccess file (if changing it would work there anyway - I don't know). Your hosting provider may have that locked down as well.

 

Share this post


Link to post
Share on other sites
5 minutes ago, bsmither said:

Setting the memory limit, if it didn't work in the script, then it won't work in the .htaccess file (if changing it would work there anyway - I don't know). Your hosting provider may have that locked down as well.

 

I just found a section on my hosting accounts website that says they set differing limits on different accounts and if exceed the limit my site wont work. That may be what is happening. I emailed them asking what the limits are. But even if I need more memory, doesn't that mean I have an issue somewhere that is causing me to need more memory? I am wondering if my paypal extension is causing issues because it removed the < from the php script again and I had to add that back and shortly after is when the http error 500 started happening. If my hosting company says my limit is 256m how do I get into my Admin Panel to try to remove the paypal extension to see if that is causing issues?

Thanks again for your help!

Share this post


Link to post
Share on other sites
Posted (edited)

If you believe you need to remove a plugin manually, then:

1. In your hosting control panel, use the File Explorer (File Manager?) to view /modules/plugins/ (might be /modules/gateway/ depending on the actual PayPal module)
2. Delete the PayPal folder
3. Using phpMyAdmin, view the CubeCart_modules table. Find and delete the record where 'folder' is "PayPal".
4. View the CubeCart_config table. Find and delete the record where 'name' = "PayPal"

The word "PayPal" is used where the actual module might be named something slightly different.

Factually speaking, if your site uses more memory than what PHP is specified to use, then PHP will crash - and report that memory had been exhausted. This is just a fact of PHP and not because of having tripped a hosting service's 'resource monitor' that will shut down your script (like, for example, hogging access to the database).

Edited by bsmither

Share this post


Link to post
Share on other sites
27 minutes ago, bsmither said:

If you believe you need to remove a plugin manually, then:

1. In your hosting control panel, use the File Explorer (File Manager?) to view /modules/plugins/ (might be /modules/gateway/ depending on the actual PayPal module)
2. Delete the PayPal folder
3. Using phpMyAdmin, view the CubeCart_modules table. Find and delete the record where 'folder' is "PayPal".
4. View the CubeCart_config table. Find and delete the record where 'name' = "PayPal"

The word "PayPal" is used where the actual module might be named something slightly different.

Factually speaking, if your site uses more memory than what PHP is specified to use, then PHP will crash - and report that memory had been exhausted. This is just a fact of PHP and not because of having tripped a hosting service's 'resource monitor' that will shut down your script (like, for example, hogging access to the database).

 I'm wondering why it's using so much memory if my first site that I copied all info from isn't crashing. Both sites are almost identical except my first site has 4 products in it and this new one only has the one product.  I was hoping if I could increase the memory limit then I could get into the Admin Panel and try updating or reinstalling my paypal extension and/or look for other issues because I am assuming increasing the memory is just a bandaid and I still need to find out why it is using so much memory. Maybe I best wait for my hosting company to get back to me after they look into it before I start changing things and confuse them more. lol. It's frustrating waiting for them to get back to me. 

Thanks again. 

Share this post


Link to post
Share on other sites

If you can ever get to an admin page....

When having visited what I guess is your site, I noticed I was getting the cached/squeezed version of your CSS files.

This tells me that you have not been able to switch on debug mode. Is this correct?

If so, visit www.showmyip.com to get your workstation's IP address.

Then, in /includes/global.inc.php, add these lines just before the last line (which is ?>😞😞

$glob['debug'] = 1;
$glob['debug_ip_addresses'] = "AAA.BBB.CCC.DDD"; // YOUR IP ADDRESS

Then, in /classes/debug.class.php, near line 221:

Find:
$this->_sql[$type][] = '<span style="color:#'.$colour.'">'.htmlentities($message.' ['.$tag.']', ENT_COMPAT, 'UTF-8').'</span>';

Change to:
$this->_sql[$type][] = $this->_debugMemoryUsage(true).' <span style="color:#'.$colour.'">'.htmlentities($message.' ['.$tag.']', ENT_COMPAT, 'UTF-8').'</span>';

This will add the peak amount of memory used to each SQL statement in the debug list. From this, we can tell just about where the sudden jump in memory consumption happened.

Share this post


Link to post
Share on other sites
14 hours ago, bsmither said:

If you can ever get to an admin page....

When having visited what I guess is your site, I noticed I was getting the cached/squeezed version of your CSS files.

This tells me that you have not been able to switch on debug mode. Is this correct?

If so, visit www.showmyip.com to get your workstation's IP address.

Then, in /includes/global.inc.php, add these lines just before the last line (which is ?>😞😞

$glob['debug'] = 1;
$glob['debug_ip_addresses'] = "AAA.BBB.CCC.DDD"; // YOUR IP ADDRESS

Then, in /classes/debug.class.php, near line 221:

Find:
$this->_sql[$type][] = '<span style="color:#'.$colour.'">'.htmlentities($message.' ['.$tag.']', ENT_COMPAT, 'UTF-8').'</span>';

Change to:
$this->_sql[$type][] = $this->_debugMemoryUsage(true).' <span style="color:#'.$colour.'">'.htmlentities($message.' ['.$tag.']', ENT_COMPAT, 'UTF-8').'</span>';

This will add the peak amount of memory used to each SQL statement in the debug list. From this, we can tell just about where the sudden jump in memory consumption happened.

no I have not been able to get back into Admin Panel to turn on debug mode. I will turn on debug and add the code you provided as soon as I am able to get back into my Admin Panel. I have asked my hosting company 4 times now how to get access to the system logs or if they can look at them and the agent is just ignoring my requests. They do this when they do not know how to do something I am asking them to do. lol. I will take time to call them a little later today and hopefully get some answers. Thanks again! 

Share this post


Link to post
Share on other sites

The edit to global.inc.php will force debug mode to be enabled, regardless what you do in admin, Store Settings.

Share this post


Link to post
Share on other sites
Posted (edited)
22 hours ago, bsmither said:

If you can ever get to an admin page....

When having visited what I guess is your site, I noticed I was getting the cached/squeezed version of your CSS files.

This tells me that you have not been able to switch on debug mode. Is this correct?

If so, visit www.showmyip.com to get your workstation's IP address.

Then, in /includes/global.inc.php, add these lines just before the last line (which is ?>😞😞

$glob['debug'] = 1;
$glob['debug_ip_addresses'] = "AAA.BBB.CCC.DDD"; // YOUR IP ADDRESS

Then, in /classes/debug.class.php, near line 221:

Find:
$this->_sql[$type][] = '<span style="color:#'.$colour.'">'.htmlentities($message.' ['.$tag.']', ENT_COMPAT, 'UTF-8').'</span>';

Change to:
$this->_sql[$type][] = $this->_debugMemoryUsage(true).' <span style="color:#'.$colour.'">'.htmlentities($message.' ['.$tag.']', ENT_COMPAT, 'UTF-8').'</span>';

This will add the peak amount of memory used to each SQL statement in the debug list. From this, we can tell just about where the sudden jump in memory consumption happened.

Okay I modified the code as you requested but when I went to my site www.ilovemybigbooty.com it now gives me the http error 500 instead of showing the site and no debug code. I noticed also in the error-log that the error was on the $trace = debug_backtrace(); statement (I should clarify I did have debug enabled but it did not show anything so I disabled it to see if the error would go away and after that I could not access my admin panel again to turn it back on). 

Edited by dianepep
added info

Share this post


Link to post
Share on other sites

Well, I finally heard back from my hosting company. Apparently their 24/7 support does not work during the weekends. lol. This is what they had to say:

"There unfortunately are no error logs on our shared hosting packages; the only available logs are those that are found in the ./logs directory of your webspace, plus the PHP scripting errors that you've already discovered how to collect.  Nevertheless, I was able to determine that the cause of the blank page was a missing autoincrement setting for the primary key of, ironically enough, the table named ilmbb_CubeCart_system_error_log in the database.  Now that that's out of the way however it's still giving me an invalid username or password error when I try to log in, so I'll try to solve that one next."

I tried to log on also and received the invalid username or password error but after trying it 3 times it did finally log me in but since then I cannot get back in. Do you know what file holds the login information? Is it as simple as my being able to access that file to force a login?

Share this post


Link to post
Share on other sites

The message is from CubeCart saying it was given an invalid username/password on CubeCart's admin login page? Or an error message from the database server that says the user/pass making the connection is not correct?

If CubeCart's admin login page, then, making sure that you are using the correct username, and that CubeCart can send emails, you can use the "Forgot Password" feature.

But, if you are not that far along and have not set up email settings, then look in the database table CubeCart_admin_users. The password is "hashed" and cannot be reversed back to the actual password.

Having logged you in once, you must have used the correct user/pass for that one time.

CubeCart may be blocking you because, within 10 minutes, you failed the login for five times.

If so, look in the database table CubeCart_blocker. Delete all the rows found there.

Share this post


Link to post
Share on other sites
27 minutes ago, bsmither said:

The message is from CubeCart saying it was given an invalid username/password on CubeCart's admin login page? Or an error message from the database server that says the user/pass making the connection is not correct?

If CubeCart's admin login page, then, making sure that you are using the correct username, and that CubeCart can send emails, you can use the "Forgot Password" feature.

But, if you are not that far along and have not set up email settings, then look in the database table CubeCart_admin_users. The password is "hashed" and cannot be reversed back to the actual password.

Having logged you in once, you must have used the correct user/pass for that one time.

CubeCart may be blocking you because, within 10 minutes, you failed the login for five times.

If so, look in the database table CubeCart_blocker. Delete all the rows found there.

It was on the login page for the Admin panel. It allowed me to log in a couple times and then just stopped so I assumed it was something my hosting company did because they are still working on it and now want me to fix it. lol. Maybe the rep was putting in the wrong password and got cubecart to block me. I will delete all rows in CubeCart_blocker. Thanks again!

Share this post


Link to post
Share on other sites

Okay it looks like they have fixed the http Error 500. This is the email I received from my hosting company support agent:

"I've corrected the rest of the missing autoincrement settings for the primary keys in the remainder of the tables that needed them, then reset the password for the admin user and now the site is working as expected.  Regarding the apparent discrepancy between the advertised 896 MB RAM available and the specifics of the error message you recorded: your package does indeed support up to 896 MB RAM, but the CubeCart installation specifically limited it, per the following code:

admin_klvcct.php

     20 ## Include the ini file (required)
     21 require 'ini.inc.php';

ini.inc.php

     21 ini_set('memory_limit', '256M');

You are of course free to modify this but it should be more than sufficient for the software.  The only reason it was hitting this limit was the result of the minor database corruption.  Only fixing the database would have fixed it -- throwing more resources at it would just have prolonged the attempt to load the page by a few more milliseconds."

I have no clue what he means by autoincrement settings. I wish he would have explained that better to me so I can check into it if it happens again. I am assuming I messed something up with the tables when I copied the review table to my new database. 

But now that is corrected it seems to have caused another issue: When I click on my product to go the product details page it does not take me there anymore and just stays on the main page. 

Share this post


Link to post
Share on other sites
Posted (edited)

Hmm. When I click on anything it just stays on the main page, whether I click on the product details, return policy, privacy policy, etc. This is what you found earlier but I didn't have a chance to look into it yet and now it seems even the product details page will not load. 

Edited by dianepep

Share this post


Link to post
Share on other sites
Posted (edited)

In admin, Maintenance, Database tab, all of the tables found in that database will be listed. Any table that does not have expected indexes (KEY or INDEX, UNIQUE, PRIMARY, FULLTEXT) will have a warning banner. You might run into a situation where a table does have a PRIMARY index, but has a redundant KEY index for the same column as the PRIMARY. In this case, CubeCart will complain that there is a missing PRIMARY index. The solution is to delete the redundant KEY index.

A column created (when the table is created or altered) can have an optional characteristic: auto-increment. This means that when a database record is inserted, the database engine determines the next higher available integer value and uses it for that column. Thus, when inserting a record, the program using the database does not need to figure this out for itself, as the highest current integer value is discovered, and the database engine automatically adds '1' to it and uses that value for the column.

Auto-increment columns are used for 'id' purposes: admin_id, product_id, customer_id, etc.

If CubeCart is showing something other than the correct product page, document page, whatever, there still may be an issue with the CubeCart_seo_urls database table. My experience is that, not that the web browser stays on the same page - as if no new request was made, but rather that CubeCart sent back the same main homepage.

 

Edited by bsmither

Share this post


Link to post
Share on other sites
Posted (edited)
2 hours ago, bsmither said:

In admin, Maintenance, Database tab, all of the tables found in that database will be listed. Any table that does not have expected indexes (KEY or INDEX, UNIQUE, PRIMARY, FULLTEXT) will have a warning banner. You might run into a situation where a table does have a PRIMARY index, but has a redundant KEY index for the same column as the PRIMARY. In this case, CubeCart will complain that there is a missing PRIMARY index. The solution is to delete the redundant KEY index.

A column created (when the table is created or altered) can have an optional characteristic: auto-increment. This means that when a database record is inserted, the database engine determines the next higher available integer value and uses it for that column. Thus, when inserting a record, the program using the database does not need to figure this out for itself, as the highest current integer value is discovered, and the database engine automatically adds '1' to it and uses that value for the column.

Auto-increment columns are used for 'id' purposes: admin_id, product_id, customer_id, etc.

If CubeCart is showing something other than the correct product page, document page, whatever, there still may be an issue with the CubeCart_seo_urls database table. My experience is that, not that the web browser stays on the same page - as if no new request was made, but rather that CubeCart sent back the same main homepage.

 

If it happens again I will check the maintenance, database tab for errors. I have no errors showing there now that it's fixed. I understand the auto-increment now. Thanks for the explanation. I looked at the CubeCart_seo_urls database but do not understand what the fields should be. There is an id, item_id, and custom fields. I assume the custom field is to signify whether someone made custom urls. I cleared all auto-generated seo urls under maintenance tab, and looked at the .htaccess file and compared it to the .htaccess file for my first store(which should be the exact same thing except the first store has 3 added products) and there were changes made by my hosting company. Could there be an issue in the .htaccess causing this? I will place the new code below:

##### START CubeCart .htaccess #####

### GZIP Compression ###
<ifmodule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</ifmodule>

### Files Expiration ###
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/html "access 0 seconds"
    ExpiresDefault "access 7 days"
</IfModule>

### File Security ###
<FilesMatch "\.(htaccess)$">
  Order Allow,Deny
  Deny from all
</FilesMatch>

### Apache directory listing rules ###
DirectoryIndex index.php index.htm index.html
IndexIgnore *

<ifModule mod_headers.c>
  Header always append X-Frame-Options SAMEORIGIN
</ifModule>

### Rewrite rules for SEO functionality ###
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
RewriteRule ^index\.php$ - [L]
  ##### START v4 SEO URL BACKWARD COMPATIBILITY #####
  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule cat_([0-9]+)(\.[a-z]{3,4})?(.*)$ index.php?_a=category&cat_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule prod_([0-9]+)(\.[a-z]{3,4})?$ index.php?_a=product&product_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule info_([0-9]+)(\.[a-z]{3,4})?$ index.php?_a=document&doc_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule tell_([0-9]+)(\.[a-z]{3,4})?$ index.php?_a=product&product_id=$1&%1 [NC]

  RewriteCond %{QUERY_STRING} (.*)$
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule _saleItems(\.[a-z]+)?(\?.*)?$ index.php?_a=saleitems&%1 [NC,L]
  ##### END v4 SEO URL BACKWARD COMPATIBILITY #####

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

### Default store 404 page ###
ErrorDocument 404 /index.php

## Override default 404 error document for missing page resources ##
<FilesMatch "\.(gif|jpe?g|png|ico|css|js|svg|webp)$">
  ErrorDocument 404 "<html></html>

Edited by dianepep
added info

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...