Open alapiere opened 1 year ago
Hey @alapiere
Do you have any other mu-plugin loader packages in your composer.json
file? And would it be possible you're loading the muplugin-loader twice?
@jdamner Getting the same issue.
error message
PHP Fatal error: Cannot redeclare LkWdwrd\MuPluginLoader\Util\rel_path() (previously declared in /var/www/html/vendor/boxuk/wp-muplugin-loader/src/Util/util.php:23) in /var/www/html/vendor/boxuk/wp-muplugin-loader/src/Util/util.php on line 23
composer.json
"require": {
"composer/installers": "^2.2",
"johnpbloch/wordpress-core": "6.3.2",
"wpackagist-plugin/wp-fastest-cache": "^1.2"
},
"extra": {
"force-mu": [
"wp-fastest-cache"
],
}
Maybe it's because we require the utils here for composer: https://github.com/boxuk/wp-muplugin-loader/blob/master/src/Composer/MuLoaderPlugin.php#L32
And another time when the generated file /wp-content/mu-plugins/mu-require.php
calls this file: https://github.com/boxuk/wp-muplugin-loader/blob/master/src/mu-loader.php#L28
After commenting out the latter it worked.
For us this seems to be happening when the theme (or plugin) is requiring the vendor/autoload.php
file to use other vendored libraries (e.g. tecnickcom/tcpdf
). I assume the definitions of this project are getting loaded in then.
I guess a simple, but not very elegant, fix would be to add some class_exists()
wrappers.
Same problem here.
Hi, I've got an error in logs and in specific custom BO page;
Not sure what caused this.
PHP Fatal error: Cannot redeclare LkWdwrd\MuPluginLoader\Util\rel_path() (previously declared in /www/XX/public/vendor/boxuk/wp-muplugin-loader/src/Util/util.php:23) in /www/XX/public/vendor/boxuk/wp-muplugin-loader/src/Util/util.php on line 23"
if I remove mu-require.php from mu-plugins, it works fine. Happy to provide any additional troubleshooting instructions if needed