Magento Core Config Data Cache - php

I had some configuration data caching issues in my magento frontend that,
I cannot get new shipping rates/get template path hints/ etc..
core_config_data table get updated correctly and All backend data shown correcty.
I tried "Flush Magento Cache" button, cleaning <DocumentRoot>/tmp directory, cleaning var/cache directory
(This issue is noticed 2 weeks before and I moved the site to new VPS a month before)
Any ideas??

Check file/folder permissions, the non-flushable, ever magically unchangable core_config_cache is usually the result of having your var/ folder tree unwritable somewhere so it all gets written to the system tmp folder.
Since the backend button only flushes contents in var/cache/, it will never touch anything in /tmp/* and you end up with this mysterious trait where it will change in the admin but the site will not read the config. I just had it happen last week on an upgrade where the permissions got changed.
Similar problem here with URLs that cannot be updated and screenshots of the system tmp cache
One of several posts on setting permissions for Magento to run

Related

Some product images are not showing in magento

I recently migrated my magento website to a different server, and here's the process I used:
Remove .htaccess folder from media folder .
rebuild all indexes as well as flush cache in the administration area.
php memory size is 512M.
Same Copy of website working fine in my localhost and different server, I am very confused what step I have to take please guide.
You missed several steps. Process of migrating Magento from local to live is
Upload all files to server
clear var/cache and var/session folder
Update live URL in core_config table web/unsecure/base_url and web/secure/base_url.
Empty log_url table
Reindexing
Still you are getting issues. Check exception.log and system.log in var/log folder.

Magento: base_url doesn't get updated after moving to another server

I moved a magento project (version 1.9.0.1) from one server to another (lets say from magento.domain.com to magentotest.domain.com). I changed the web/unsecure/base_url and web/secure/base_url in the core_config_data table, I also changed the paths in the local.xml
I deleted everything var/cache, var/session and var/tmp and yet when I try to access magentotest.domain.com I am always redirected to the old page (magentotest.domain.com/admin as well)
I tried to track the problem in the magento code and what I found was that in Mage_Core_Store_Model the URL called with $this->getConfig('web/unsecure/base_url') still contains magento.domain.com - and for the life of me I cannot find out why.
Having googled this for three hours now and what I found was a clue that magento sometimes stores its cache files in the SYSTEM tmp folder. When I looked there I found a folder magento/var/cache but it was empty. I deleted it but to no avail.
I don't know what else to do. Did anyone ever encounter this problem?
seems like mine was a special case: for performance reasons, there was an extension named "redis cache" installed and only when I emptied THAT, it finally worked.

Prestashop redirects to old domain after changing it in Database

I am trying to create a copy of a prestashop 1.6 e-shop for development purposes from domain.com to dev.domain.com
The process I followed is
Disable cache and compilation
Copy the files from domain.com to dev.domain.com
Dump the mysql database from domain.com in dump.sql
Open dump.sql on vi and search and replace using :%s/domain.com/dev.domain.com/g
Import dump.sql in the devdb
Open prestashop cpanel and verify all shop url configuration is changed.
Open phpmyadmin and check that all domain.com entries have changed to dev.domain.com
Deleted files from /cache/smarty/compile /cache/cachefs
Rebuild .htaccess file from prestashop.
Changed login credentials in the devdb so that the website will load that one
Now the problem is that when I open dev.domain.com i still get redirected to domain.com and I'm at a loss as to what to try next.
Searching for domain.com in phpmyadmin in the devdb doesn't yield results
grep -ri 'domain.com' * doesn't yield results either in the files
Any suggestions what I can try next?
PS: domain.com and dev.domain.com are two different domains. Not similar in anyway
For prestashop 1.7 you have to modify some values in the database:
ps_configuration table and change PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL to your new domain name, e.g. mydomain.com
ps_shop_url table and change again ‘domain’, ‘domain_ssl’ fields to your new domain name and ‘physical_uri’. If you copied files into
root folder, the path will be simply ‘/’.
More on https://blog.premium-templates.eu/how-to-move-prestashop-from-localhost-to-domain-or-vice-versa
Note: browsers cache redirections, you will have to clean your browser cache. Check https://www.getfilecloud.com/blog/2015/03/tech-tip-how-to-do-hard-refresh-in-browsers/ to know how to do a "hard refresh" for your browser.
First of all it's great that you follow each step in correct manner. Now the problem is:-
When ever you are running any domain on your browser. Browser create cache and cookie for this. If you change any setting of your domain, it will not reflect till you not clear your browser cache and cookie completely.
So just remove your browser cache and cookie and try to check is it working or not.
Note:- Based on your process that you follow, this only problem seems to exist.
Your procedure is right, there is only a few factors that may cause your issue
Make sure that there is no manual redirection in your web server configuration (or old .htaccess for Apache)
Change Prestashop domains from the database (detailed below)
Clear all your cache Update Prestashop domains from the database (detailed below)
Always test with a browser in incognito/developer mode, disabling all cached redirections. I personally use an incognito Chrome window, in developer mode
When debugging, it is a good idea to inspect the logs from your webserver as well as the network exchanges from your browser to identify the source of the issue
Here are a few rudimentary scripts I use to automate the cache cleanup and domain change for Prestashop 1.7.
1. Change Prestashop's domain
Use a template file to generate a .sql file to patch the database. If more convenient, you can manually run that on your database directly.
patch-domain.sql.template:
UPDATE ps_configuration SET value='${SHOP_DOMAIN}' WHERE name='PS_SHOP_DOMAIN';
UPDATE ps_configuration SET value='${SHOP_DOMAIN}' WHERE name='PS_SHOP_DOMAIN_SSL';
UPDATE ps_shop_url SET domain='${SHOP_DOMAIN}', domain_ssl='${SHOP_DOMAIN}';
Generate the real .sql patch file, and apply it
$ export SHOP_DOMAIN=mydomain.com
$ envsubst < patch-domain.sql.template > patch-domain.sql
$ mysql -u <username> -p <database> < patch-domain.sql
2. Clear Prestashop cache
Remove all cache files except index.php
clear-cache.sh:
#!/bin/bash
base_dir='./shared/prestashop/html'
# Clear class index in case any override changed
rm ${base_dir}/cache/class_index.php
declare -a cache_dirs=(
"cache/smarty/compile"
"cache/smarty/cache"
"cache/cachefs"
"img/tmp" # You might want to keep tmp images
"themes/*/cache"
"var/cache")
# Clear all cache folder, ignoring 'index.php'
for dir in "${cache_dirs[#]}"
do
echo Cleaning ${base_dir}/${dir}...
find ${base_dir}/${dir} -type f ! -name index.php -delete
done
EDIT: The updated gist is accessible here
Clear browser cache, nothing to see with this error, the real answer is change PS_SHOP_DOMAIN and PS_SHOP_DOMAIN_SSL in ps_configuration and ps_shop_url table
This is an old post but maybe someone will be helped
follow these steps : https://zemez.io/prestashop/support/how-to/prestashop-1-7-transfer-website-one-domain-another/
In parameters.php change the date also to actual
In config/defines.inc set define('PS_MODE_DEV', true); so admin panel will not be a blank page
Finish

Magento DEV. clone are redirectingg to the main URL [duplicate]

We have moved out magento site to another host. But it is redirecting to the old site
We did following changes before moving the site
1. DB backup
2. files are zipped and copied to another host.
after moving the site to another host
1. changed the /web/secure and /web/unsecure values in the DB.
2. In magento files /app/etc/local.xml changed the database name.
3. cleared the var/cache
4. cleared the var/tmp
5. cleared the var/session.
but still the magento site is redirected to old site.
Can any one help me with this.
Thanks
Several steps involved in cloning or moving a website.
NOTE: It's common practice to empty the var/cache, var/session directories before copying to new location. Clearing cache is mentioned below as it's necessary to clear the cached config after you've run through the list and properly set database access, BaseURL, etc.
Copy application files to new location and import database into MySQL. (best to do this with a tarball and database dump sql file, ftp has issues with things like getting .htaccess files to transfer, case to matter, etc.) Note: more sophisticated Magento admins use rsync, it's far easier.
(important!!) Make sure file/folder permissions and owner/group are correct so that var/ folder system is writable. Otherwise the Magento cache gets written in system /tmp instead of Magento var/ and only a server reboot or manual deletion will clear Magento cache out of /tmp . Also, not having var/ writable means that any drastic errors that write a file to var/report/ will fail to write any stack traces, compounding your installation heartburn.
Make sure app/etc/local.xml points to the proper database and make sure if you back up the original local.xml that it doesn't end in .xml -> needs to be something like local.xml.sv1
Change your database entries Unsecure BaseUrl for and Secure BaseURL to point to your new location (http://www.example.com and if ssl cert installed https://www.example.com respectively). Use phpmyadmin to look for the paths web/unsecure/base_url and web/secure/base_url in the core_config_data table. (Note: entries will exist for each scope set, minimum is Global)
Manually clear your cache by deleting all the mage--? subfolders in var/cache
If you were using the compiler on the previous site, disable compiler with SSH command line php shell/compiler.php disable from the Magento root.
Attempt to load your admin backend, you should be on the new server URL now.
Following these steps should clear all the hiccups that cause Magento to adamantly redirect back to the old server. And believe me, I've had them all happen.

Magento 302 when accesing installation

I've installed magento countless times and been getting the same error. When trying to access the installation, magento sends a 302 redirect to the first ip it got installed in ( 192.168.10.144 ). I feel like I tried every trick in the book.
there is no /tmp/magento folder on my machine.
deleted several times /var/www/html/magento/var/cache and /var/www/html/magento/var/session
Magento has a default behaviour to auto redirects you to his Base URL.
If you want to change it, open up your Magento DB and in the table core_config_data your old IP 192.168.10.144 should appear as value for the path web/unsecure/base_url and web/secure/base_url.
Just change it to the new IP or URL you want there, then clean your caches again, and voila.
If you just want to reinstall it, just delete all the table and the file app/etc/local.xml and you should be able to run through the install process again.

Categories