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

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
peter_b
Chatterbox
Posts: 381
Joined: Tue Nov 12, 2013 2:05 am

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

Post 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
Post Reply