Skip to content

[6.0.0alpha1] PHP Fatal Error when upgrading on PHP 5.3 #5313

Closed

Description

@christinloehner

Expected behaviour

Upgrade should work and the server should work

Actual behaviour

upgrade.php throws PHP Fatal Error:
"PHP Fatal error: Cannot redeclare class OC_Config in /srv/xxxx.xxxxx.xxx/www/lib/config.php on line 41"

Steps to reproduce

  1. run an older version (here 5.3.8-1~dotdeb.1) of PHP-FastCGI together with Nginx
  2. Backup your old config/config.php
  3. Delete all from your htdocs directory
  4. Copy all from the 6.0.0alpha1.tar.bz2 archive to the htdocs dir
  5. Copy your config.php back to config/config.php
  6. Try to run upgrade.php

Server configuration

Operating system: Ubuntu 10.04 (Kernel: 2.6.32-52-server)

Web server: nginx 1.3.14

Database: MySQL 5.5.27

PHP version: 5.3.8-1~dotdeb.1 FastCGI

ownCloud version: 5.0.12 to 6.0.0.alpha1

Client configuration

Browser: Firefox 24

Operating system: Ubuntu 13.04 and Windows 8

Activity

  1. Niduroki commented on Oct 12, 2013

    @Niduroki
  2. DeepDiver1975 commented on Oct 12, 2013

    @DeepDiver1975
    Contributor

    @bartv2 any idea? THX

  3. christinloehner commented on Oct 13, 2013

    @christinloehner
    Author

    aren't you doing autoload for classes?
    That would have several advantages:

    1. only really needed classes gets loaded
    2. much faster because of 1
    3. such errors wouldn't happen again, regardeless which PHP version is used.
      :-)

    EDIT: Okay, just found the autoloader... but then there must be something wrong. Maybe I can find the compatibility problem....

  4. GieltjE commented on Oct 14, 2013

    @GieltjE

    This also happens when using php 5.4.x

  5. VicDeo commented on Oct 14, 2013

    @VicDeo
    Contributor

    @GieltjE do you have any PHP opcode caher (xcache, apc...)?

  6. GieltjE commented on Oct 14, 2013

    @GieltjE

    @VicDeo apc was enabled, when I disable it owncloud still gives the same error, using a raspberry pi with PHP Version 5.4.4-14+deb7u5

  7. bantu commented on Oct 14, 2013

    @bantu

    Is this the full error message? The error is usually followed by a "previously defined in ..." message.

  8. christinloehner commented on Oct 15, 2013

    @christinloehner
    Author

    Unfortunatly, that is the only and full error message... :(

    2013/10/11 09:00:05 [error] 3524#0: *11893 FastCGI sent in stderr: "PHP Fatal error: Cannot redeclare class OC_Config in /srv/cloud.xxxxx.xxx/www/lib/config.php on line 41" while reading response header from upstream, client: 95.91.243.185, server: cloud.xxxxx.xxx, request: "GET /index.php/apps/news/folders? HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "cloud.xxxxx.xxx", referrer: "http://cloud.xxxxx.xxx/index.php/apps/news/"

    No other error before or after that error message.

  9. DeepDiver1975 commented on Oct 15, 2013

    @DeepDiver1975
    Contributor

    Maybe we get more information if php xdebug is installed? 

  10. GieltjE commented on Oct 15, 2013

    @GieltjE
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP Fatal error:  Cannot redeclare class OC_Config in /var/www/owncloud/lib/config.php on line 41
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP Stack trace:
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP   1. {main}() /var/www/owncloud/index.php:0
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP   2. require_once() /var/www/owncloud/index.php:28
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP   3. OC::init() /var/www/owncloud/lib/base.php:907
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP   4. OC::initPaths() /var/www/owncloud/lib/base.php:433
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP   5. OC\\Autoloader->load() /var/www/owncloud/lib/base.php:0
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP   6. OC\\Memcache\\Factory::createLowLatency() /var/www/owncloud/lib/autoloader.php:122
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP   7. OC\\Memcache\\Cache->__construct() /var/www/owncloud/lib/private/memcache/factory.php:53
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP   8. OC_Util::getInstanceId() /var/www/owncloud/lib/private/memcache/cache.php:21
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP   9. OC\\Autoloader->load() /var/www/owncloud/lib/private/memcache/cache.php:0
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP  10. require_once() /var/www/owncloud/lib/autoloader.php:143
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP  11. OC\\Autoloader->load() /var/www/owncloud/lib/autoloader.php:0
    [Tue Oct 15 06:30:43 2013] [error] [client 192.168.1.100] FastCGI: server "/var/www/fastcgi/php5.fastcgi" stderr: PHP message: PHP  12. require_once() /var/www/owncloud/lib/autoloader.php:143
    

    Edit: Put this into a code box - bantu

  11. ghost assigned on Oct 16, 2013
  12. VicDeo commented on Oct 16, 2013

    @VicDeo
    Contributor

    @GieltjE can you try flushing memcache storage?

  13. christinloehner commented on Oct 17, 2013

    @christinloehner
    Author

    is memcache a requirement for >=6.0? I have no memcache running until now.

  14. DeepDiver1975 commented on Oct 17, 2013

    @DeepDiver1975
    Contributor

    Memcache is not required.

  15. GieltjE commented on Oct 17, 2013

    @GieltjE

    @VicDeo I do not have memcache, just APC, with that disabled the result is the same

  16. bantu commented on Oct 17, 2013

    @bantu

    It seems you have the OC_Config class file twice. There should only be one file at lib/legacy/config.php, but you seem to also have lib/config.php.

  17. bantu commented on Oct 17, 2013

    @bantu

    This should be caused by the fact that all $pathsToRequire are require_once'd. This does not make sense to me. See https://github.com/owncloud/core/blob/master/lib/autoloader.php#L143

  18. GieltjE commented on Oct 17, 2013

    @GieltjE

    @bantu lib/config.php still exists from the before the upgrade..... Removing it seems to fix the problem though.

  19. GieltjE commented on Oct 17, 2013

    @GieltjE

    Searched for a upgrade document in the archive, not online for some reason.

  20. bantu commented on Oct 17, 2013

    @bantu

    Closing as such.

  21. locked as resolved and limited conversation to collaborators on Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions