Magento db connection settings will not change, crazy caching?

I 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 values ​​of the connection string in the file "magento / app / etc / local.xml". I checked about a hundred times that it was changed. And before you tell me that it is cached, I deleted the entire directory "magento / var / cache" to be safe, and grepped all the files in the www directory for our "secret_password". Below is a snippet of my local.xml file.

<host><![CDATA[localhost]]></host>
<username><![CDATA[root]]></username>
<password><![CDATA[root]]></password>
<dbname><![CDATA[dev_xarisma]]></dbname>

I tried this on my laptop and found that there was a problem with caching. It took me hours to figure this out. But I finally ended up dropping the Varien_Db_Adapter_Pdo_Mysql object, and it was when I saw that the values ​​it received were not the values ​​that I 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

Finally, I realized that the old login credentials were cached by grepping in the www directory for our strong password. I was surprised to see a bunch of files in the magento / var / cache file. I deleted the abusive files and this solved the problem on my laptop. However, it does not work on the workstation. I deleted the entire var directory and the behavior continues. I even rebooted my workstation several times if it was something Apache cached, but not good luck.

Ubuntu 31.10, Apache2, mySql . , , , , , Production. , , , , . .

+3
4

, , . , , , .

, "magento/app/etc" , "local.xml" . "localOLD.xml". , - ; . , , Magento THAT "local.xml" .

, , . , . "local.xml" , "localOLD.xml", , Magento .

? -?

+8

, .

, ? - , redis, memcache .. , n98-magerun ( ) .

- , ? Magento var - PHP, .

#File: app/code/core/Mage/Core/Model/Config/Options.php
public function getVarDir()
{
    //$dir = $this->getDataSetDefault('var_dir', $this->getBaseDir().DS.'var');
    $dir = isset($this->_data['var_dir']) ? $this->_data['var_dir']
        : $this->_data['base_dir'] . DS . self::VAR_DIRECTORY;
    if (!$this->createDirIfNotExists($dir)) {
        $dir = $this->getSysTmpDir().DS.'magento'.DS.'var';
        if (!$this->createDirIfNotExists($dir)) {
            throw new Mage_Core_Exception('Unable to find writable var_dir');
        }
    }
    return $dir;
}

, Magento .

var_dump($dir);
return $dir;
+5

I also struggled with this for a while. I moved all my backup local.xml files to another directory and fixed it. Thanks

0
source

How Magento works, it reads all the files in this directory in alphabetical order. Thus, the backup is ok if you make sure that the backup file is read before the real file.

-1
source

All Articles