I am new in cs cart.
I have done the following steps
1.downloaded a cs-cart-V3 website to my localhost.
2.Change database setting,and import database.
3.$config['http_host'] = 'localhost'; added in **config.local.php** file.
4.Removed .htaccess file from root folder.
My problem is
The site was loaded,But the path of css is wrong.It is trying to load from localhost Not from localhost/subfolder,
Where i need to change this?
Please check config.local.php
Mainly the following lines:
// Host and directory where software is installed on no-secure server
$config['http_host'] = '';
$config['http_path'] = '';
Please make sure that the store-front URL is also correct. It can be checked:
In the cscart_companies table in the database (storefront and secure_storefront columns)
On the Administration -> Stores page (Storefront URL and Secure storefront URL fields)
At the end, do not forget to clear cache. You can do it by adding the "?cc&ctpl" to the URL in the admin panel. E.g.
http://your_domain.com/your_admin.php?cc&ctpl
Related
Background: had a working Wordpress 3.7 site at olddomain.com.
I moved it to newdomain.com successfully, and in the process added this to wp-config:
define('WP_HOME','http://newdomain.com');
define('WP_SITEURL','http://newdomain.com');
Now when I attempt to login from newdomain.com/wp-admin I'm getting the cross-browser error (despite having cookies enabled and clearing existing cookies):
ERROR: Cookies are blocked or not supported by // your browser.
You must enable cookies to use WordPress.
I tried going into wp-login.php and commenting out the following lines (744-747) to stop the conditional testcookie check
// If cookies are disabled we can't log in even with a valid user+pass
if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) )
$user = new WP_Error('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by // your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));
else
$user = wp_signon('', $secure_cookie);
but doing that leaves me stuck in a redirect loop back to the admin page:
http://myapp.com/wp-login.php?redirect_to=http%3A%2F%2Fmyapp.com%2Fwp-admin%2F&reauth=1
Do I need to change (or not set) the site URL? or is there another potential way to troubleshoot this? thanks
add to wp-config.php
define('ADMIN_COOKIE_PATH', '/');
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', '');
define('SITECOOKIEPATH', '');
original source http://wordpress.org/support/topic/cookie-error-site-not-letting-me-log-in
Having migrated hundreds of WP sites, here's a few thoughts :
If migrating the DB : Check the database options table (probably wp_options) column "option_name" that values "siteurl" and "home" have the correct "option_value" for your site. "siteurl" is huge.
I can testify that the options table tweak is the bare minimum required to migrate a DB to a new domain in WP. (will not cause redirection, will still have issues)
WP looks up these DB options to serialize the site to domain and I am pretty sure the defines are lower in the stack and of no help. Consider the wp-admin activities as loosely coupled to the front. You can break everything (done it) in the front and the admin will still function.
Also - did/does the site work with generic install/no migration or tweaks?
As mentioned - .htaccess (missing or misconfigured) will cause your error. Regarding the .htaccess file, if used, this is a dot.file and many operating systems will "ignore" or "make invisible" so a copy/paste or FTP application or similar may not carry the .htaccess
(pretty sure on this) If you moved the DB and used pretty urls, and missed the .htaccess that could be all you need to fix. I just tested locally on a sandbox install and the table wp_option column "option_name" value "permalink_structure" when left blank in column option_value will return to ?p=1 (non-permalink) status and .htaccess will be mostly bypassed.
This worked for me.
Remove //define('COOKIE_DOMAIN', 'www.domain.com');in your wp-config.php
Ensure that all the files have the ANSI format and not utf-8
This error also occurs when moving a multisite installation to a new domain if you update all options on the database table (usually wp_options), but forget to change the DOMAIN_CURRENT_SITE line on wp-config.php:
define( 'DOMAIN_CURRENT_SITE', 'yourdomain.com' );
I experienced this due to my caching plugin.
W3 Total Cache had added the following to my wp-config.php file:
define('COOKIE_DOMAIN', 'www.olddomain.com'); // Added by W3 Total Cache
Since it was hard coded, it didn't update to the new site domain. After deleting the added code (because I don't currently use the plugin), I was able to log in again.
I'd check wp-config.php for the word "cookie" to see if a plugin might have added something like this.
I was getting this same error.
I had hard coded the Home and SiteURL in wp-config.php for a brand new website - no plugins even installed.
The problem: I had a space at the end of the URL.
define('WP_HOME','http://100.000.000.01/~acctname/wp ');
define('WP_SITEURL','http://100.000.000.01/~acctname/wp ');
Removing the space fixed this error.
define('WP_HOME','http://100.000.000.01/~acctname/wp');
define('WP_SITEURL','http://100.000.000.01/~acctname/wp');
this bug was driving me crazy the last couple of days so i thought after fixing it to share with you guys! the problem was when i was trying to login into my wordpress backend i got this annoying cookies error so this is how i fixed it!
Go to your ftp and your domain.
Afterwards go to your wp-contents
Go to your themes folder
Chose the theme that is active
Look for functions.php of your teem and open it
At the ende of the code you should see closing tag p> just remove it clear the spaces also and save it!
Go to your domain.com/wp-login.php
and try to login it should be fixed afterwards you can put the tag back where it was and save it again that was the solution for me this trick also fixes the white page problem in wordpress
Cheers!
I have been googled & tried all ways to get rid of this cookie issue. Finally i found two solutions, which could help you.
Solution 1:
yoursite/wp-login.php
Comment following lines 770-773
Code
if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) )
$user = new WP_Error('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));
else
$user = wp_signon('', $secure_cookie);
It might work for some websites and some sites may show blank page. Moreover, this is not recommended,as this file may be overridden after wordpress update so try for second solution.
Solution 2:
yoursite/wp-content/themes/yourthemeFolder/functions.php
Place following code.
setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN);
if ( SITECOOKIEPATH != COOKIEPATH )
setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN);
Updating of your theme may also loose these changes so please place this code in another functions.php, which is under your child-theme folder in your current active theme. Hope, this will help you.
Assuming you are running on a Unix/Linux type platform - please ensure you have copied your .htaccess file from your original server and updated any references to the old domain within that file. It will be in the root of your wordpress deployment (if you are using it).
Either that or you may have a reference to your old domain somewhere in your wp_options table within the database.
Be forewarned that as you have moved from one domain to another, images and media locations within posts may need to be updated. You can either do that yourself directly within the database, use a find/replace utility or manually re-point your images within your posts. An alternative method to fix your post data is to export all your posts from your old site (from within the admin panel) - Tools > Export > All posts; then manually update the URL within that resultant file before importing to your new site.
All of this and much more is covered over at codex.wordpress.org. For more information see this link:
http://codex.wordpress.org/Changing_The_Site_URL
IMPORTANT NOTES:
If you are going to modify anything directly within the database, make sure you read the section that talks about GUIDs
If you are using Better WP Security, there are other things you may need to do, but based on what you are describing, I doubt you have it installed.
I had the same problem with very similar circumstances and spec.
Eventually after trying all sorts of different solutions suggested online, I just renamed my active theme via FTP and then was able to login to the dashboard, I renamed my theme back and everything worked, I've no idea why but it may help somebody fix issues they're having.
I had the same problem and nothing works. After upgrading my php 5.3.x to 5.4.x it works fine.
Following step solve my issue
on wp-config.php
//define('WP_CACHE', true); // Added by W3 Total Cache Block this line
//define("COOKIE_DOMAIN", "www.domain.com"); Block this line
Delete following files from wp-content
object-cache.php
advanced-cache.php
db.php
I created my Multisite install long ago when you needed a plugin for domain mapping. So I had the file '/wp-content/sunrise.php' and in the wp-config define( 'SUNRISE', 'on' ); It's been working just fine until a recent update to WordPress.
I viewed these errors in my debug.log:
Undefined index: HTTP_HOST in ../public_html/wp-content/sunrise.php on line 10
Undefined index: HTTP_HOST in ../public_html/wp-includes/ms-settings.php on line 57
So I deleted the sunrise file and wp-config sunrise definition and added #max4ever/#duck_boy's cookie definitions to the wp-config file:
define('ADMIN_COOKIE_PATH', '/');
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', '');
define('SITECOOKIEPATH', '');
That solved the problem. I can now login!! Note: I tried this definition and it worked as well. Taken from Multisite Setup Guide
define( 'COOKIE_DOMAIN', $_SERVER[ 'HTTP_HOST' ] );
I came across this error when trying to install a wordpress site on localhost. The problem was this line inside the .htaccess
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
It prevents cookies being set if not on https. Just had to remove the line.
I have found very good solution of this issue
There are possible following solutions for this error
Coding Error
Unnecessary Spaces in Code
Caching & Security Plugin
Check this article: https://www.scratchcode.io/cookies-are-blocked-or-not-supported-by-your-browser/
My WordPress login page at mysite.com/wp-login.php is giving me a cannot connect to 127.0.0.1 error.
The site works, and other WordPress admin pages are available, like upgrade.php. I've done some googling, tried some of the suggestions here: http://wordpress.org/support/topic/error-establishing-a-database-connection-112
But to no avail. Admin has been working for weeks and nothing has been changed. Everything also looks correct in config.php. The site is on AN Hosting, and I logged into the phpMyAdmin on the cPanel and everything seems to be in order with the database
I have very little experience with database issues and MySQL, so I am a little flummoxed.
Same problem. AN Hosting is blocking you. They are blocking any attempt to login on some of their shared servers. I changed wp-login.php page to a new address, and corrected all references in the WordPress folder.
Now everything works fine. However, it will only work until the next update.
AN Hosting says they are doing this only temporarily because they've been facing some type of attack on WordPress logons. If you ask me this is very lame. They need to resolve this issue.
Call them! I will also call them again and complain.
Thats strange if it was working before, and not now.
I'm used to get trouble connecting to my database with WordPress (since I'm installing WordPress websites many oftern), but when ever it failed for me the problem were in the hostname
I would suggest you to check your database hostname, if you can log in to cPanel you can find out form the data base interface
Look here:
Then check this section for the hostname:
If you specified correctly there should be no problem
After seen the comment you left after your question, this came to my mind
Go into
PhpMyAdmin -> Your WP Database -> Options Table and check the site url value, it might be still pointing to your old dev url
So based on the answer given by #user3035755 , I can give you the following work-around:
In your root directory, create a file called(for instance - you can change that if you want to) login.php(not sure if the word "login" would be accepted - you might have to play around with it a bit, until something works). In this file add the following code:
<?php
include_once( dirname( __FILE__ ) . '/wp-login.php' );
This code will include the original wp-login.php file. I'm not sure how their restriction works - if it's based on where the call to the database is being made(as in from which exact file), then it might fail due to the fact that the connection would still be made from wp-login.php(although I assume that's not how they did it). If they instead check the file that is being executed, then you should be fine(since in that case it would be login.php - again, you might have to change that).
Now, that's just the first step - you can either manually go to login.php every time you want to log-in, but it'd be better if the login URL is automatically adjusted. To do that, go to the /wp-content/ directory and create(if it doesn't already exists) a mu-plugins1 directory. In there create a new file, called new-login.php and in that file put the following code:
<?php
/*
Plugin Name: New Login URL
Plugin Description: Makes the login URL /login.php instead of /wp-login.php
*/
function nl_login_url_filter( $login_url ) {
return str_ireplace( home_url( '/wp-login.php' ), home_url( '/login.php' ), $login_url );
}
add_filter( 'login_url', 'nl_login_url_filter', 10 );
function nl_logout_url( $logout_url ) {
return str_ireplace( home_url( '/wp-login.php' ), home_url( '/login.php' ), $logout_url );
}
add_filter( 'logout_url', 'nl_logout_url', 10 );
So what happens in this plugin, is that it simply hooks to the login_url and logout_url filters and changes http://mydomain.com/wp-login.php?test1=23&test4=56 to http://mydomain.com/login.php?test1=23&test4=56.
This way you don't have to take care of always entering login.php instead of wp-login.php.
Again - if that doesn't work, try using a different name for the file, like enter.php(for instance), just remember to change the file name in the new-login.php file as well.
Footnotes:
The /wp-content/mu-plugins/ directory is a special directory. All .php files directly inside it(not in a sub-directory) get included in alphabetical order. So basically any plugin you put in there will always be enabled(the only way to disable a mu-plugin is to delete it's file in the mu-plugins directory). You can read more about mu-plugins here
Been there done that, but that does not mean my guide-lines have the same positive result
for you but maybe it helps a little. Below a small roadmap with steps you could take:
These 2 (site url and home) you could add in wp_config.php.
define('WP_HOME','http://yoursite.com');// blog url
define('WP_SITEURL','http://yoursite.com'); // site url
Did it make any change for login? maybe you check the phpMyAdmin (through cPanel).
Check wp_options ( the $table_prefix = '???_' ??? is what you have put there,
you find it in wp-config.php).
Now look at line 1 option_id 1 / option_name siteurl / option_value here must be your domain url.
Now find around line 36 option_id 36 / option_name home / option_value here should be your domain url.
IF they where not correct I assume you made corrections, saved them into the db and check if you are able to login now.
Stil not working? maybe following would good to check also:
What the .htaccess file shows (correct path?)
Add if not already done some debug "stuff" in wp_config.php:
define( 'WP_DEBUG', true ); // Or false to disable
if ( WP_DEBUG ) {
define( 'WP_DEBUG_LOG', true ); // writes errors down in wp-content/debug.log
define( 'WP_DEBUG_DISPLAY', true ); // shows errors on screen output, set to false so only write into logfile
define('SAVEQUERIES', true); // will have a performance impact so disable if not needed
define('SCRIPT_DEBUG', true); // Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
}
If no debug.log is shown in wp-content you create the file by hand.
Btw, is the wp-login.php having the correct chmod? (644 it should be)
Do you have/use cache plugins if so, could try to disable it by renaming folder.
Do you have some caching options through .htaccess if so, disable it for the moment.
Do you use a login plugin or script? If so, disable it for the moment being.
You could check functions.php (in your theme folder) if there is some code-snippet which could do a redirect for your wp-login.php, if so disable it for the moment.
Last but not least, if all above still not was solving your problem you could rename the plugins folder for a moment and try to login. (don't forget tot rename it back afterwards)
I hope that one of these will help you to find the solution.
Ask your hosting provider what your database host should be and update the DB_HOST line in wp-config.php accordingly.
This is usually localhost or 127.0.0.1 but on some hosts it may be something completely different that you would not be able to guess without asking - for example I've had long weird hostnames supplied by GoDaddy for this before (years ago when I still used GD for anything).
I do have 5 shops:
http://www.mainshop.com
http://www.mainshop.com/subshop/
http://www.mainshop.com/subshops/
http://www.mainshop.com/subshops3/
http://www.mainshop.com/subshop4/
But everytime i click on the url for a categroy it keeps giving a Magento 404 error.
I did copy the index.php and htaccess to that subdirs and changed this line:
/* Store or website code */
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : 'subshop1';
/* Run store or run website */
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'website';
I also changed the configuration of that specific website:
The 404 comes to cms pages and category pages. Can't figure it out.
Magento creates a full links like this:
{{unsecure_base_url}}../skin/
http://www.example.com/shop/../skin/
which wont work ofcourse... Try inserting the full links ;)
Like this:
http://www.example.com/skin/
Have you used store views for each shop on one magento installation? You should not have sub directories for each shop and no need to copy index.php or any other file to a subdirectory. I think you have misunderstood how magento store views work. What you should do is enable the option for the storecode to be shown in each URL. When you setup your store view you specify the code which will be used (e.g. subdir1, subdir2 or whatever you want it to be). You need to use store views as you are using the same base URL which you need to change back to be default for each store view so it should be http://www.mainshop.com/ for every store view or website. This will allow you to achieve what you are trying to, without modding any magento code. Read this document in the wiki for more information how to do it properly http://www.magentocommerce.com/knowledge-base/entry/overview-how-multiple-websites-stores-work/
I am currently working on a magento site that is in 2 languages (French and Dutch). The approach I am taking is as follows:
Create a folder in the web root (named nl)
Import the index.php and .htaccess file to that folder
In the index.php I modify the following line:
Mage::run('nl'); // to specify the store view i want to load
When I check, the categories, CMS content etc are still in the default language. The following code:
Mage::app()->getStore()->getName();
returns the fr store's name.
What is it that I'm doing wrong? I think a viable solution would be to set the store to run in index.php...
Could someone please let me know how to load a store by ID?
After hours of huffing and puffing i was able to figure out a way to set the store id programatically :)
In the index.php file, (in your language specific folder), add the following:-
$store_id = 'your_store_id_here';
$mageRunCode = 'store view code';
$mageRunType = 'store';
Mage::app()->setCurrentStore($store_id);
Mage::run($mageRunCode, $mageRunType);
Hope someone will find this information useful :)
You will get all store details here
<?php
$allStores = Mage::app()->getStores();
foreach ($allStores as $_eachStoreId => $val)
{
$_storeCode = Mage::app()->getStore($_eachStoreId)->getCode();
$_storeName = Mage::app()->getStore($_eachStoreId)->getName();
$_storeId = Mage::app()->getStore($_eachStoreId)->getId();
echo $_storeId;
echo $_storeCode;
echo $_storeName;
}
?>
To redirect to the specified store, you need to redirect the page along with the store code.
http://www.mywebsite.com/index.php/store_code/
Please check the template/page/switch/stores.phtml for more details
If the reason you're doing the htaccess stuff is so that you can generate URLs specific to each store, you may want to go with the configuration option that does that for you, should be in System > Config > Web
I am having a bit of a problem. I am duplicating my website to a test environment on a new server with a new domain.
I have it working fine with the database etc but here is my error.
On the live site if I click suppliers it goes to the page fine If I click it on the test environment it does not work.
These are two links
http://wvtest.co.uk/
http://theweddingvine.com/
The code to create the link is as follows:
<?php
echo anchor('search', 'Suppliers');
?>
The file and the folders are the same. Is there something in codeigniter which can direct the link ?
Modify application/config/config.php and set:
$config['base_url'] = "http://{$_SERVER['HTTP_HOST']}/";
That will make your links work on either server.
have you specified the correct base_path for your testing server in application/config/config.php file?
Check that please, this is the case mostly in such problems.
You could change your base_url to
$config['base_url'] = 'http://wvtest.co.uk/';
or
$config['base_url'] = '/';