Magento的db连接参数不会改变,疯狂的缓存? [英] Magento db connection parameters won't change, crazy caching?
问题描述
我已将我们的整个www目录从我们的网络服务器复制到我的本地工作站。我试图让Magento连接到本地数据库。是的,我更改了magento / app / etc / local.xml文件中的连接字符串值。我已经验证了大约一百倍,它已经改变。在你告诉我它被缓存之前,我已经删除了整个magento / var / cache目录,只是为了安全,grepp www目录中的所有文件为我们的secret_password。下面是我的local.xml文件的摘录。
I have copied our entire www directory from our web server to my local workstation. I am trying to get Magento to connect to a local database. Yes, I changed the connection string values in the 'magento/app/etc/local.xml' file. I have verified about a hundred times that it has been changed. And before you tell me that it is cached, I have deleted the entire 'magento/var/cache' directory, just to be safe, and grepped all files in the www directory for our 'secret_password'. Below is an excerpt from my local.xml file.
<host><![CDATA[localhost]]></host>
<username><![CDATA[root]]></username>
<password><![CDATA[root]]></password>
<dbname><![CDATA[dev_xarisma]]></dbname>
我在我的笔记本电脑上试过,发现缓存是问题。它花了我几个小时才弄清楚。但我终于最终倾销了Varien_Db_Adapter_Pdo_Mysql对象,这是当我看到它获得的值不是我在local.xml文件中设置的值;请参阅下面的部分转储。
I tried this on my laptop, and did find that caching was the issue. It took me hours to figure it out. But I finally ended up dumping the 'Varien_Db_Adapter_Pdo_Mysql' object, and that is when I saw that the values it was getting were not the values I had set in the 'local.xml' file; see partial dump below.
[_config:protected] => Array
(
[host] => localhost
[username] => root
[password] => (*secret_pass_you_cant_see*)
[dbname] => production_xarisma
我最后发现,较旧的登录凭据通过grepping WWW目录我的强密码我惊讶地发现在一堆文件在magento / var /缓存文件中我删除了有问题的文件,并解决了我的笔记本电脑上的问题,但它不工作在工作站,我有删除整个var目录,并且行为继续。我甚至重新启动了我的工作站几次,以防它被Apache缓存,但没有运气。
I finally figured out that the older login credentials were cached by grepping the WWW directory for our strong password. I was surprised to find in in a bunch of files in the magento/var/cache file. I removed the offending files, and that solved the problem on my laptop. However, it's not working on the workstation. I have deleted the entire var directory, and the behavior continues. I have even rebooted my workstation several times in case it was something being cached by Apache, but no luck.
笔记本电脑和工作站正在运行Ubuntu 31.10,Apache2,目前的mySql,没有什么奇怪的,只是为了防止你想知道为什么我会做这个疯狂的克隆生产服务器到我的工作站的程序,正试图缓解只有在生产中的问题。是的,我检查了所有的文章,甚至似乎是相关的。先谢谢。
Both the laptop and the workstation are running Ubuntu 31.10, with Apache2, current mySql, and nothing freaky on either. And just in case you want to know why I would be doing this crazy "cloning the production server to my workstation" procedure, it because we are trying to chace down a problem that is only in Production. Yes, I checked all of the articles that even seemed to be related. Thank you in advance.
推荐答案
好的,这花了我两天时间来追踪。但是我发现的是一个错误或一个功能,我不知道。
OK, this took me two days to track down. But what I found is either a bug, or a feature, I don't know.
问题是在magento / app / etc '目录,也就是OVERRIDING'local.xml'文件中正确的数据库连接参数。此文件称为localOLD.xml。显然,有人想要备份我们的数据库设置安全;一个好主意。但显然,Magento正在读取THAT文件而不是'local.xml'。
The problem was that there was ANOTHER file in the 'magento/app/etc' directory, that was OVERRIDING the correct database connection parameters in the 'local.xml' file. This file was called 'localOLD.xml'. Obviously, someone wanted to backup our database settings for safety; a good idea. But apparently, Magento was reading THAT file instead of 'local.xml'.
我真的很惊讶,它一开始工作,我删除那个文件。其实,我不相信。所以我制作了一个'local.xml'的副本,称为localOLD.xml,为连接参数输入一些测试值,Magento尝试使用它们。
I was really surprised that it started working as soon as I deleted that file. In fact, I did not believe it. So I made a copy of 'local.xml', called it 'localOLD.xml', entered some test values for the connection parameters, and Magento tried to use them.
这是一个错误或功能?任何人?
Is this a bug or a feature? Anyone?
这篇关于Magento的db连接参数不会改变,疯狂的缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!