Magento db 连接参数不会改变,疯狂缓存? [英] Magento db connection parameters won't change, crazy caching?

查看:25
本文介绍了Magento db 连接参数不会改变,疯狂缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已将整个 www 目录从我们的 Web 服务器复制到我的本地工作站.我正在尝试让 Magento 连接到本地数据库.是的,我更改了magento/app/etc/local.xml"文件中的连接字符串值.我已经验证了大约一百次它已被更改.在你告诉我它被缓存之前,为了安全起见,我已经删除了整个magento/var/cache"目录,并为我们的secret_password"搜索了 www 目录中的所有文件.以下是我的 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

我终于发现旧的登录凭据是通过在 WWW 目录中查找我们的强密码来缓存的.我惊讶地发现在 magento/var/cache 文件中的一堆文件中.我删除了有问题的文件,这解决了我笔记本电脑上的问题.但是,它不适用于工作站.我已经删除了整个 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"目录中有另一个文件,它覆盖了local.xml"文件中正确的数据库连接参数.该文件名为localOLD.xml".显然,有人想备份我们的数据库设置以确保安全;一个好主意.但显然,Magento 正在读取该文件而不是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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆