Page 1 of 1

PHP Fatal error: "Cannot declare class" (due to symlink)

Posted: Thu Dec 17, 2020 12:00 am
by peter_b
[PROBLEM]
I ran into the following error message when I tried to make CollectiveAccess (CA) available in another folder that was merely a symbolic link to the previous installation:
PHP Fatal error: Cannot declare class WidgetManager, because the name is already in use in /var/www/providence-ca/app/lib/WidgetManager.php on line 41
I'm posting this here, because this may happen with any other PHP site as well.


[SOLUTION]
Apache needs to be restarted to "let go" of the previously instantiated class.

Code: Select all

$ systemctl restart apache2