1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

change folder error

Discussion in 'XenForo Questions and Support' started by Marquinhos, Mar 23, 2013.

  1. Marquinhos

    Marquinhos Member

    I tried to change the server folder and looks that gave the error. http://testserver.test for http://testserver.test/comunidade this error:

  2. Chris D

    Chris D XenForo Developer Staff Member

    Are the files still in the old location?
  3. Marquinhos

    Marquinhos Member

    not already moved to the new location.
  4. Mike

    Mike XenForo Developer Staff Member

    If you're running APC, you likely need to restart the web server. This is an APC bug.
    smimosmile and Jake Bunce like this.
  5. Sidane

    Sidane Active Member

    I have a similar issue. Just looked at my apache error logs this morning and they were flooded with:

    PHP Fatal error:  require_once(): Cannot redeclare class zend_db in /<snip>/library/Zend/Db/Adapter/Abstract.php on line 27, referer: http://www.redcafe.net/threads/david-de-gea.334187/
    Looked like nearly every request was reporting that error, although the topics were loading fine. I also noticed that my old vBulletin URL redirects weren't working anymore, e.g. http://www.redcafe.net/f27/retro-video-game-thread-366557/ was returning a 500 response. Not good when Google comes crawling any old URLs.

    Once I restarted Apache the errors in the logs stopped and the redirects started working again.

    Mike, do you have any specifics on what this APC bug is? Having to restart Apache on a regular basis is not a good solution. Is there a better workaround/fix for this problem? If not, are there any viable, more stable alternatives to APC?

    FYI, my cache config is setup as follow:

    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_redcafe_live_';
    $config['cache']['cacheSessions'] = true;
    $config['cache']['backend'] = 'Memcached';
    // ....rest of memcache config...
  6. Mike

    Mike XenForo Developer Staff Member

    It only applies when you move files - likely directory containing files - so it really shouldn't happen with any frequency. I'm guessing at how APC works internally.

    You could try something like Xcache.
  7. Sidane

    Sidane Active Member

    Thanks for the prompt reply!

    I automate the deployment of my site, so changes are committed to a git repo and the repo is cloned into a new directory on the live server when I deploy. This new directory is then symlinked to a directory Apache can serve. This strategy allows for easy rolling back to previous releases if something goes wrong.

    So given that with each deploy 1) the directory from which the site is served changes and 2) Apache is not restarted, could this be causing these APC errors?

    If so, then the solution would be to ensure Apache is restarted after each deploy?
  8. Mike

    Mike XenForo Developer Staff Member

    That sounds like it'd work. Clearing the APC cache might work as well.

Share This Page