MASSIVE speed improvement

Johnbol,



If those lines are not within your current config.local.php file, then you have a problem!



Good chance that file was corrupted some how, so personally, I would grab a fresh file from the CS-cart (same version) download, re-enter my site particular settings and re-upload this to my site.



Also, johnbol you really should start displaying the version you are currently running as it helps reduce confusion between all the different versions. (I was rather certain you are on one of the later versions, although I am only assuming.)

[quote name=‘Struck’]

Also, johnbol you really should start displaying the version you are currently running as it helps reduce confusion between all the different versions. (I was rather certain you are on one of the later versions, although I am only assuming.)[/QUOTE]



OOOPs musy have deleted it by accident when I changed mi sig to show VPS last week.

Thanks for pointing it out

So I decided to add the missing lines to my config.php.



cleared the cache and smart optimizer cache, now all i get on front end is division by zero in fn.catalog line 52 error as per other thread.



Took out the code I had just pasted in for backend cache and still no images and same error after clearing cache folders again.

I think I probably need the config.local.php for v2.1.3



any advice struck



Thanks

John

Try using this line now and see if it will rebuild the var/cache file structure again.



```php $config[‘cache_backend’] = ‘file’; ```

[QUOTE]So I decided to add the missing lines to my config.php.[/QUOTE]



John, I hope you meant to say “config.local.php” instead!



Let me see if I can upload an un-modified original config.local.php file from 2.1.3 for you.

Here you go Johnbol, this is original from 2.1.3 release


```php
/***************************************************************************

  •                                                                      *
  • Copyright (c) 2004 Simbirsk Technologies Ltd. All rights reserved. *
  •                                                                      *
  • This is commercial software, only users who have purchased a valid *
  • license and accept to the terms of the License Agreement can install *
  • and use this program. *
  •                                                                      *

****************************************************************************

  • PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE *
  • “copyright.txt” FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. *

    ***************************************************************************/





    //

    // $Id: config.local.php 11725 2011-01-28 08:11:25Z 2tl $

    //



    if ( !defined(‘AREA’) ) { die(‘Access denied’); }



    /

  • PHP options

    /



    // Disable notices displaying

    error_reporting(E_ALL ^ E_NOTICE);

    if (version_compare(PHP_VERSION, ‘5.3.0’, ‘>=’)) {

    error_reporting(error_reporting() & ~E_DEPRECATED);

    }



    // Set maximum memory limit

    @ini_set(‘memory_limit’, ‘48M’);



    // Set maximum time limit for script execution

    @set_time_limit(3600);



    /

  • Database connection options

    /

    $config[‘db_host’] = ‘%DB_HOST%’;

    $config[‘db_name’] = ‘%DB_NAME%’;

    $config[‘db_user’] = ‘%DB_USER%’;

    $config[‘db_password’] = ‘%DB_PASSWORD%’;

    $config[‘db_type’] = ‘mysql’;



    /

  • Script location options

    *
  • Example:
  • Your url is http://www.yourcompany.com/store/cart
  • $config[‘http_host’] = ‘www.yourcompany.com’;
  • $config[‘http_path’] = ‘/store/cart’;

  • Your secure url is https://secure.yourcompany.com/secure_dir/cart
  • $config[‘https_host’] = ‘secure.yourcompany.com’;
  • $config[‘https_path’] = ‘/secure_dir/cart’;

    *

    /



    // Host and directory where software is installed on no-secure server

    $config[‘http_host’] = ‘%HTTP_HOST%’;

    $config[‘http_path’] = ‘%HOST_DIR%’;



    // Host and directory where software is installed on secure server

    $config[‘https_host’] = ‘%HTTPS_HOST%’;

    $config[‘https_path’] = ‘%HOST_DIR%’;



    /

  • Misc options

    */

    // Names of index files for administrative and customer areas

    $config[‘admin_index’] = ‘admin.php’;

    $config[‘customer_index’] = ‘index.php’;

    $config[‘vendor_index’] = ‘vendor.php’;



    // DEMO mode

    $config[‘demo_mode’] = false;



    // Tweaks

    $config[‘tweaks’] = array (

    ‘js_compression’ => false, // enables compession to reduce size of javascript files

    ‘check_templates’ => true, // disables templates checking to improve template engine speed

    ‘inline_compilation’ => true, // compiles nested templates in one file

    ‘anti_csfr’ => false, // protect forms from CSFR attacks (experimental)

    ‘disable_ajax_preload’ => false, // used to disable ajax preload for speed-up admin area

    ‘disable_block_cache’ => false, // used to disable block cache

    );



    // Cache backend

    // Available backends: file, sqlite, mysql, shmem

    // To use sqlite cache the “sqlite3” PHP module should be installed

    // To use shmem cache the “shmop” PHP module should be installed

    $config[‘cache_backend’] = ‘file’;



    // Key for sensitive data encryption

    $config[‘crypt_key’] = ‘YOURVERYSECRETKEY’;



    // Database tables prefix

    define(‘TABLE_PREFIX’, ‘cscart_’);



    // Default permissions for newly created files and directories

    define(‘DEFAULT_FILE_PERMISSIONS’, 0666);

    define(‘DEFAULT_DIR_PERMISSIONS’, 0777);



    // Maximum number of files, stored in directory. You may change this parameter straight after a store was installed. And you must not change it when the store has been populated with products already.

    define(‘MAX_FILES_IN_DIR’, 1000);



    // Developer configuration file

    if (file_exists(DIR_ROOT . ‘/local_conf.php’)) {

    include(DIR_ROOT . ‘/local_conf.php’);

    }



    define(‘AUTH_CODE’, ‘’);



    ?> ```

[quote name=‘Struck’]John, I hope you meant to say “config.local.php” instead!

[/QUOTE]





I did mean config.local.php sorry struck my mistake.

I appreciate your time on this. Thanks fo rthe file I will alter it and give it a go.

One saving grace is that it is Sat am now here and the site is usually quiet on weekends so I have a bit of time to get this sorted.

I asked Martfox support and they said try to delete /var/cache/ and /var/compiled/ directories.

I did this each time but no success.

Thanks

[quote name=‘Struck’]Here you go Johnbol, this is original from 2.1.3 release


```php




Hey Hey…Someone give that man a medal.



Thanks Struck… back up and running with that. Really appreciate your help after my eagerness/stupidity to try something on the live site taught me a lesson.



Thanks

John

Good to hear you are back in business Johnbol1 !



Yeah, you don’t want to go after those config files with a hatchet… :smiley:

[quote name=‘Struck’]The url method will clear the cache regardless of which cache method used. Personally I prefer to delete the entire /var/cache as well as /var/compiled directories thru ftp and watch them rebuild.[/QUOTE]



Do you delete everything in those directories, or just certain files? I don’t want to get rid of something important. Thanks!

[QUOTE]Do you delete everything in those directories, or just certain files? I don’t want to get rid of something important. Thanks![/QUOTE]



Yes, all files, nothing to fear as they will immediately begin to rebuild as the pages of your site are visited. :wink:

[quote name=‘Struck’]Yes, all files, nothing to fear as they will immediately begin to rebuild as the pages of your site are visited. ;)[/QUOTE]



Great, thanks for the info. I have thousands of files there so it will help me store out a lot. At this point whenever I try and clear the cache the page just goes to a blank browser page. I feel like it never actually clears the entire cache.



How often do you clean those folders out, and are there any drawbacks to doing so?



FYI- I just switched my cache from FILES to SQLITE. Will this help as well?

[QUOTE]How often do you clean those folders out, and are there any drawbacks to doing so?[/QUOTE]



Well, I am running 2.1.4 and never clear the cache unless I have made changes to our site which requires clearing the cache. No longer a good idea at all to continually clear the cache as it defeats the entire purpose of having a cache system in the first place! (So quit mucking around with it…!) :wink:




[QUOTE]FYI- I just switched my cache from FILES to SQLITE. Will this help as well?[/QUOTE]



Yes, you will now end up with one nice tidy database containing the cached information vs. 18,0000000 individual files when using the file type cache system.

buuuuuuuu… is this fast now… thanks for the hint … !!







My settings:



@ini_set(‘memory_limit’, ‘128M’);

$config[‘cache_backend’] = ‘sqlite’;

I recompiled apache with shmop enabled and I get this error when trying to use shmem. Any ideas?



Fatal error: Call to undefined function shmop_read() in /core/cache/class.cache_backend_shmem.php on line 91

[quote name='dotell' timestamp='1330113621' post='131998']

I recompiled apache with shmop enabled and I get this error when trying to use shmem. Any ideas?



Fatal error: Call to undefined function shmop_read() in /core/cache/class.cache_backend_shmem.php on line 91

[/quote]



After changing your config.local.php cache type to shmem, did you also clear your cs-cart cache afterwards to eliminate “turbulence” and rebuild fresh?

Not sure Apache is where you want to enable shmem. I would think you would want it enabled in PHP.

[quote name='tbirnseth' timestamp='1330117114' post='132005']

Not sure Apache is where you want to enable shmem. I would think you would want it enabled in PHP.

[/quote]



I think it has to be “enabled” when building apache or the php version I guess. I wasn't able to do it myself, I had to have suppost staff do it. I'm pretty sure there are no php.ini settings or anything like that for it though. Sqlite didn't work for me either, even though that's enabled as well. I had the same error others have reported.

[quote name='Struck' timestamp='1330114844' post='131999']

After changing your config.local.php cache type to shmem, did you also clear your cs-cart cache afterwards to eliminate “turbulence” and rebuild fresh?

[/quote]



Yes, did that. Still received this msg >> “Shared memory cache data storage is not supported. Please choose another one.”

[quote name='dotell' timestamp='1330134424' post='132037']

Yes, did that. Still received this msg >> “Shared memory cache data storage is not supported. Please choose another one.”

[/quote]



Then this message is telling you that your server does not actually have the “SHMOP” (i believe that is what it is called) module installed or configured correctly for use as your cache choice as selected in your config.local.php file.



Personally, I would focus on using the SQLITE cache method and getting this to work properly on your site.



Go to your CS-Cart Admin panel, then click Administration>Database>PHP Information

Then look towards the bottom of your phpinfo page to see if there is a block of information labeled SQLITE3, if there is not, then either install this module or ask your hosting provider for assistance as this is needed for the SQLITE cache method to work for you.