Question

I am trying to move my website(-s) to a new server. On my old server, Magento and Database were on the same box. This Magento installation Serves two Stores. I bought two new servers one for the DB and one for Magento only. My migration path was:

  • Copy old database and move it to the new database server.
  • Change DB settings in app/etc/local.xml.
  • Cleaned up var/cache and var/ sessions.

So far so good. Everything till here works as usual, no errors. So I moved to new Server to install Magento:

  • Downloaded Magento, extracted it in root web folder.
  • Copied all(!) files from old webserver and put it in the new.
  • Changed permissions to:

    chown web37:client1 * -R
    chown web37:client1 .htaccess
    find . -type d -exec chmod 755 {} \\;
    find . -type f -exec chmod 644 {} \\;
    chmod -R o+w media var
    chmod o+w app/etc
    chmod 777 includes includes/config.php
    rm -rf var/cache/*
    rm -rf var/session/*
    
  • Changed in .htaccess from

    Options +FollowSymLinks
    

    to

    Options FollowSymLinks
    

    and

    #RewriteBase /magento/
    

    to

    RewriteBase /
    
  • Added to Apache:

    AcceptPathInfo on
    

this configuration gives back the

    dbModel read resource does not implement Zend_Db_Adapter_Abstract

error with the trace:

    #0 /var/www/clients/client1/web3/web/app/code/core/Mage/Core/Model/Resource/Db/Collection/Abstract.php(134): Varien_Data_Collection_Db->setConnection(false)
    #1 /var/www/clients/client1/web3/web/app/code/core/Mage/Core/Model/Config.php(1348): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Object(Mage_Core_Model_Resource_Website))
    #2 /var/www/clients/client1/web3/web/app/code/core/Mage/Core/Model/Config.php(1380): Mage_Core_Model_Config->getModelInstance(\'core_resource/w...\', Object(Mage_Core_Model_Resource_Website))
    #3 /var/www/clients/client1/web3/web/app/Mage.php(490): Mage_Core_Model_Config->getResourceModel(\'core/website_co...\', Object(Mage_Core_Model_Resource_Website))
    #4 /var/www/clients/client1/web3/web/app/code/core/Mage/Core/Model/Abstract.php(208): Mage::getResourceModel(\'core/website_co...\', Object(Mage_Core_Model_Resource_Website))
    #5 /var/www/clients/client1/web3/web/app/code/core/Mage/Core/Model/Abstract.php(213): Mage_Core_Model_Abstract->getResourceCollection()
    #6 /var/www/clients/client1/web3/web/app/code/core/Mage/Core/Model/App.php(608): Mage_Core_Model_Abstract->getCollection()
    #7 /var/www/clients/client1/web3/web/app/code/core/Mage/Core/Model/App.php(466): Mage_Core_Model_App->_initStores()
    #8 /var/www/clients/client1/web3/web/app/code/core/Mage/Core/Model/App.php(349): Mage_Core_Model_App->_initCurrentStore(\'\', \'store\')
    #9 /var/www/clients/client1/web3/web/app/Mage.php(683): Mage_Core_Model_App->run(Array)
    #10 /var/www/clients/client1/web3/web/index.php(87): Mage::run(\'\', \'store\')
    #11 {main}

If change the permissions to 777 of the var folder the server tells me it had a 500 error but i can see absolutely nothing about this error in the error logs although if i change the Apache log level to \"LogLevel debug\" :( Same if i delete or rename the cache folder. Nothing helps and i don't really know what can i do next. I have tried many many times to reinstall and I'm working to solve the problem nearly since one week. Any help would be nice :(

Notices:

  • If I trying a fresh install everything works fine
  • A new Install after remove the old local.xml file wants that some folders in 777, but breaks at next step (after the database initialising) in 500 error.
  • Both Server have the Magento requirements, both local.xml\'s are identical.
  • Old Magento Server:
    • CentOS 5.9
    • H-Sphere 3.6.1
    • Magento Community 1.7.0.2
    • mod_php
  • New Magento Server:

    • CentOS 6.4
    • ISPConfig 3.0.5.2
    • Magento Community 1.7.0.2
    • mod_php
    • suphp.conf:

      [global]
      ;Path to logfile
      logfile=/var/log/httpd/suphp.log
      ;Loglevel
      loglevel=info
      ;User Apache is running as
      webserver_user=apache
      ;Path all scripts have to be in
      docroot=/var/www
      ;Path to chroot() to before executing script
      ;chroot=/mychroot
      ; Security options
      allow_file_group_writeable=true
      allow_file_others_writeable=false
      allow_directory_group_writeable=true
      allow_directory_others_writeable=false
      ;Check wheter script is within DOCUMENT_ROOT
      docroot=/var/www
      ;Send minor error messages to browser
      errors_to_browser=false
      ;PATH environment variable
      env_path=/bin:/usr/bin
      ;Umask to set, specify in octal notation
      umask=0022
      ; Minimum UID
      min_uid=100
      ; Minimum GID
      min_gid=100
      [handlers]
      ;Handler for php-scripts
      x-httpd-suphp="php:/usr/bin/php-cgi"
      ;Handler for CGI-scripts
      x-suphp-cgi="execute:!self"
      umask=0022
      umask=0022
      
Was it helpful?

Solution

Firstly,

  1. suPHP is slow, unless it is a multi tenant environment, just use mod_PHP - its far simpler to manage and confugure
  2. Why are you using an external DB server with a single web server. In the majority of cases, this will be slower than them both being on the same system.

Look at the configuration you posted, allow_file_others_writable and allow_directory_others_writable is set to false. Ie. You're not allowed to use 777 until you change those settings.

But the whole point of suPHP is so that permissions can be tight (eg. 744 and 644) because the PHP process runs as the right user to begin with.

Ensure you can actually connect to your DB server via command line - it looks like a misconfigured set up.

OTHER TIPS

I got the same error when I am trying to upgrade store.

How I avoid this issue, Backup all 3rd Party extension module xml files (from app/etc/modules) and then remove these files from app/etc/modules.

With this, above error is gone. I installed Magento and then add extensions files back. All things worked as expected.

Hope this will help you.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top