Hi,
I have problem with migrating my CS Cart Installation on localhost.
I have clone the website source to my local htdocs and import the database on my local mysql server. And then here is adjustment I have made:
- Change the database configuration, http and https hostname and path on "config.local.php" file.
- Change Rewritebase to localhost path on ".htaccess" file.
- Change 'url', 'storefront'. and 'secure_storefront' on 'cscart_companies' table on the database.
Here is the file:
-config.local.php
if (!defined('BOOTSTRAP')) { die('Access denied'); }/*
- PHP options
*/
// Log everything, but do not display
error_reporting(E_ALL);
ini_set(‘display_errors’, 0);
// Set maximum memory limit
if (PHP_INT_SIZE == 4 && (substr(ini_get(‘memory_limit’), 0, -1) < “64”)) {
// 32bit PHP
@ini_set(‘memory_limit’, ‘64M’);
} elseif (PHP_INT_SIZE == 8 && (substr(ini_get(‘memory_limit’), 0, -1) < “256”)) {
// 64bit PHP
@ini_set(‘memory_limit’, ‘10256M’);
}
if (!defined(‘CONSOLE’)) {
// Set maximum time limit for script execution.
@set_time_limit(0);
}
/*
- Database connection options
*/
$config[‘db_host’] = ‘localhost’;
$config[‘db_name’] = ‘_dbname’;
$config[‘db_user’] = ‘root’;
$config[‘db_password’] = ‘’;
$config[‘database_backend’] = ‘mysqli’;
// Database tables prefix
$config[‘table_prefix’] = ‘cscart_’;
/*
- 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’] = ‘localhost’;
$config[‘http_path’] = ‘/development/cscart’;
// Host and directory where software is installed on secure server
$config[‘https_host’] = ‘localhost’;
$config[‘https_path’] = ‘/development/cscart’;
/*
- Misc options
*/
// Names of index files for the frontend and backend
$config[‘customer_index’] = ‘index.php’;
$config[‘admin_index’] = ‘admin.php’;
// DEMO mode
$config[‘demo_mode’] = false;
// Tweaks
$config[‘tweaks’] = array (
// Whether to remove any javascript code from description and name of product, category, etc.
// Auto - false for ULT, true for MVE.
‘sanitize_user_html’ => ‘auto’,
‘anti_csrf’ => true, // protect forms from CSRF attacks
‘disable_block_cache’ => false, // used to disable block cache
‘disable_localizations’ => true, // Disable Localizations functionality
‘disable_dhtml’ => false, // Disable Ajax-based pagination and Ajax-based “Add to cart” button
‘dev_js’ => false, // set to true to disable js files compilation
‘redirect_to_cart’ => false, // Redirect customer to the cart contents page. Used with the “disable_dhtml” setting.
‘api_https_only’ => false, // Allows the use the API functionality only by the HTTPS protocol
‘api_allow_customer’ => false, // Allow open API for unauthorized customers
‘lazy_thumbnails’ => false, // generate image thumbnails on the fly
‘image_resize_lib’ => ‘gd’, // library to resize images - gd or imagick,
‘products_found_rows_no_cache_limit’ => 100, // Max count of SQL found rows without saving to cache
);
// Key for sensitive data encryption
$config[‘crypt_key’] = ‘’;
// Cache backend
// Available backends: file, sqlite, database, redis, xcache, apc
// To use sqlite cache the “sqlite3” PHP module should be installed
// To use xcache cache the “xcache” PHP module should be installed
// To use apc cache the “apc” PHP module should be installed
$config[‘cache_backend’] = ‘file’;
$config[‘cache_redis_server’] = ‘localhost’;
$config[‘cache_redis_global_ttl’] = 0; // set this if your cache size reaches Redis server memory size
// Storage backend for sessions. Available backends: database, redis
$config[‘session_backend’] = ‘database’;
$config[‘session_redis_server’] = ‘localhost’;
$config[‘cache_apc_global_ttl’] = 0;
$config[‘cache_xcache_global_ttl’] = 0;
// CDN server backend
$config[‘cdn_backend’] = ‘cloudfront’;
// Storage options
$config[‘storage’] = array(
‘images’ => array(
‘prefix’ => ‘images’,
‘dir’ => $config[‘dir’][‘root’],
‘cdn’ => true
),
‘downloads’ => array(
‘prefix’ => ‘downloads’,
‘secured’ => true,
‘dir’ => $config[‘dir’][‘var’]
),
‘statics’ => array(
‘dir’ => & $config[‘dir’][‘cache_misc’],
‘prefix’ => ‘statics’,
‘cdn’ => true
),
‘custom_files’ => array(
‘dir’ => & $config[‘dir’][‘var’],
‘prefix’ => ‘custom_files’
)
);
// 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_once(DIR_ROOT . ‘/local_conf.php’);
}
// Enable DEV mode if Product status is not empty (like Beta1, dev, etc.)
if (PRODUCT_STATUS != ‘’ && !defined(‘DEVELOPMENT’)) {
ini_set(‘display_errors’, ‘on’);
ini_set(‘display_startup_errors’, true);
define('DEVELOPMENT', false);
}
- .htaccess
DirectoryIndex index.html index.php # Compress HTML, CSS, JavaScript, Text, XML, fonts AddOutputFilterByType DEFLATE application/javascript application/x-javascript text/javascript application/json AddOutputFilterByType DEFLATE application/x-font application/x-font-opentype application/x-font-otf application/x-font-truetype application/x-font-ttf font/opentype font/otf font/ttf application/x-woff application/x-font-woff AddOutputFilterByType DEFLATE text/css text/html text/plainHeader set Access-Control-Allow-Origin "*"
# Remove browser bugs (only needed for really old browsers) BrowserMatch ^Mozilla/4 gzip-only-text/html BrowserMatch ^Mozilla/4\.0[678] no-gzip BrowserMatch \bMSIE !no-gzip !gzip-only-text/html Header append Vary User-Agent Cache all images for 2 weeks
ExpiresActive on ExpiresDefault "access plus 2 weeks" Header set Cache-Control "max-age=1209600" RewriteEngine on # Please note that RewriteBase setting is obsolete use it only in case you experience some problems with SEO addon. # Some hostings require RewriteBase to be uncommented # Example: # Your store url is http://www.yourcompany.com/store/cart # So "RewriteBase" should be: # RewriteBase /store/cart RewriteBase /development/cscart Options -MultiViewsRewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} ^api/(.)$ [or]
RewriteCond %{REQUEST_URI} ./api/(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .api/(.)$ api.php?_d=$1 [L,QSA]RewriteCond %{REQUEST_URI} .(png|gif|ico|swf|jpe?g|js|css|ttf|svg|eot|woff|yml|xml)$ [or]
RewriteCond %{REQUEST_URI} store_closed.html$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.?)/(.)$ $2 [L]RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L,QSA]This prevents possible problems when downloading files
php_flag zlib.output_compression Off
But the site returned blank page when I access the store front page. The admin page cannot be accessed too, it return error 414 (Request-URI Too Long).
I have try to clear the cache folder too, but still the same. I have try to find solution but no result, any idea about this issue? Thanks in advance.