Reoccuring "Cannot redeclare class" error
Permalink
A few days ago, the two concrete5 websites that I operate began starting to lock up and STOP working with the following error:
One is a brand new installation of 8.0.3, however the other is 5.7.5.6, and has been operating for well over a year with no issues. The error originally appeared when you tried to access pages when logged in, but today I attempted to go to a the website while not logged in and the error was present. What seemed to fix this was restarting the Apache service, but the issue is recurring. There is no other information given with the error, however I have found the file it is referring to (I think), called Target.php.
The only information I can offer as to what was changed prior to this error occurring was the installation of the new 8.0.3 site on the same server (which is also having this issue), and the deletion of quite a number of picture files from the 5.7 site's file manager, since some content was being moved over to another website.
All other non-c5 websites on the server are functioning normally.
Server specifications:
Debian8
Apache 2.4.10
PHP 5.6.29
Cannot redeclare class Doctrine\Common\Annotations\Annotation\Target
One is a brand new installation of 8.0.3, however the other is 5.7.5.6, and has been operating for well over a year with no issues. The error originally appeared when you tried to access pages when logged in, but today I attempted to go to a the website while not logged in and the error was present. What seemed to fix this was restarting the Apache service, but the issue is recurring. There is no other information given with the error, however I have found the file it is referring to (I think), called Target.php.
The only information I can offer as to what was changed prior to this error occurring was the installation of the new 8.0.3 site on the same server (which is also having this issue), and the deletion of quite a number of picture files from the 5.7 site's file manager, since some content was being moved over to another website.
All other non-c5 websites on the server are functioning normally.
Server specifications:
Debian8
Apache 2.4.10
PHP 5.6.29
I've found similar issues relating to Drupal, and one post I found referred to caching. Since this reminded me that I also introduces caching with these sites not long ago, I have disabled the Apache2 module "expires", and will see if this impacts anything.
I can confirm that this issue comes back even with the Expires module turned off. No clue what could be causing it.
In addition, I have found more information from the Concrete5 Dashboard log after restarting Apache. This error was the last exception present:
Exception Occurred: /var/www/lorenzorvgs/concrete/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Target.php:31 Cannot redeclare class Doctrine\Common\Annotations\Annotation\Target (1)
I see one major problem with this error: It is referring to /var/www/lorenzorvgs
That is the OTHER concrete5 website, NOT the site that I am accessing (which would be under /var/www/concrete). In addition, I found in the other sites logs that its errors were occurred when trying to access /var/www/concrete, so somehow these two sites are looking to eachother for files, and I cannot figure out why.
In addition, I have found more information from the Concrete5 Dashboard log after restarting Apache. This error was the last exception present:
Exception Occurred: /var/www/lorenzorvgs/concrete/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Target.php:31 Cannot redeclare class Doctrine\Common\Annotations\Annotation\Target (1)
I see one major problem with this error: It is referring to /var/www/lorenzorvgs
That is the OTHER concrete5 website, NOT the site that I am accessing (which would be under /var/www/concrete). In addition, I found in the other sites logs that its errors were occurred when trying to access /var/www/concrete, so somehow these two sites are looking to eachother for files, and I cannot figure out why.
I am seeing the same thing you described. So far I have not found a solution.
The only way to stop the problem so far has been to restart the server. This is not really a solution because the problem keeps coming back.