Fatal error: Class 'ResponsiveMenu' not found in /var/www/html/wp-content/plugin
-
Given error gotten when trying to activate Responsive Menu plugin.
At first when the plugin was activated, that crashed the whole blog. Then the plugin dir was renamed and site gotten back up but still unable to get this plugin running.Not sure if this occurred immediately after last update on this plugin (I have auto updates on plugins enabled) but I’ve already removed the plugin and tried reinstalling and keep getting the same error.
Any help with this?
-
First time this error’s in log is at Tue Dec 29 06:55:02 2015 (UTC+2)
I changed the line:
require_once ‘autoload.php’;
to:
require_once plugin_dir_path( __FILE__ ).’autoload.php’;
from /var/www/html/wp-content/plugins/responsive-menu/app/bootstrap.php (that’s what should be in the topic) and it seems to be working.Hi micsu,
Apologies I have been away on holiday for a while but am back now.
I have never heard of this issue before and never seen it on any of my development sites.
I will take a further look but a new update is due to be released early February and will likely fix any issues you have.
All the best
Thanks for the response.
This is indeed quite odd issue, while it appeared at the time described above and no updates for this plugin or WP core seems to be made then.I’ve currently disabled automatic plugin updates but I’ll have to check whether the next update for the plugin will fix this issue or not.
Not sure what could’ve caused this but my custom fix is as described above. Maybe you’ll add something similar if can’t find the reason for the require path there to be invalid?
Hi there,
If it still gives you a problem in future please let me know and I will try my best to replicate as at the moment I am unable.
All the best
Yeah, I’ll inform about that after next update.
Currently running with that fix of mineHi micsu,
Perfect – update should be out today so stay tuned…
All the best
Nope, this ain’t resolved on plugins side.
Got the same 500 fatal error and same custom fix saved meUnfortunately I can’t give you access to the site, while it’s the companys WP and I’m just the guy maintaining it. It’s located at http://blog.appelsiini.fi/ but I’m thinking that doesn’t give you a lot.
The WP is a network installation with just one site using this plugin.
The theme used is a custom made child template for Responsive Theme.
I’ve also included TGM Plugin Activitation to this child theme and it requires Responsive menu plugin as well as 6 others (7 if you count one custom made author detail expansion plugin).I also think this is very weird issue as it appeard so suddenly, without updates in this plugin or wordpress.
I’m not that familiar about how WordPress works but just a thought:
In DOCROOT/wp-content/plugins/responsive-menu/responsive-menu.php file bootstrap is required by line:
require_once ‘app/bootstrap.php’;
Then, in DOCROOT/wp-content/plugins/responsive-menu/app/bootstrap.php the autoload is loaded with:
require_once ‘autoload.php’;Now, these both are the first lines of actual code in both files, so it should start with this plugin by running:
require_once ‘app/bootstrap.php’; -> require_once ‘autoload.php’;
Due to inclusions, the cwd for both cases is DOCROOT/wp-content/plugins/responsive-menu/ and that’s why autoload.php won’t load and that results the fatal errors.Hi there.
It should be fine – you are the only person I have ever heard of that has this issue.
require_once ‘autoload.php’ loads from the same folder as the bootstrap.php folder so there is no issue as it loads it relatively.
It may be you have some strange server or PHP setting that is changing normal file inclusion paths – it may be worth speaking to your host about it instead.
All the best
Yeah, I do realise that I’m the only one having this problem.
I just don’t understand why.I have seen no documentation that PHP inclusion paths would work in WordPress relatively to the file it’s included from.
Inclusion happens relatively to the executed script file and directories defined in include_path.It doesn’t really matter that autoload.php and bootstrap.php are in the same directory while bootstrap is included from parent directorys responsive-menu.php script with ‘app/bootstrap.php’.
The inclusion for autoload.php is checking the parent directory (plugin root directory) and include_path.
Should the <plugin dir>/app be defined especially in the include_path or do you have some config magic that follows the relative includes through files (without escpecially usign: include(dirname(__FILE__)./included_file.php’)) ?
Hi there,
Why would the inclusion for autoload.php look in the plugin root directory if it is being called from the app directory?
It will work from where it is called, same as on any server command line – if you are in a directory and you run a file by that name in that folder it will find it, it doesn’t jump back a folder or need specifying the folder name absolutely from the server root.
There is no config magic needed, like I said with over 350,000 downloads this is the first time I have ever heard of this issue which makes me suspect its a server setting somewhere, what did your host say?
In the next release I can include a strict include path which will hopefully fix your issue – I will add it to the beta later for testing.
All the best
Just to clarify, I meant that while the executed script file is responsive-menu.php in script root directory, that includes ‘app/bootstrap.php’, the current working directory is still the plugin root dir, right?
Then through the inclusion of boostrap.php, it tries including ‘autoload.php’.Sorry bout keeping talking about this, I’m still just trying to make sense why I get the error and other people don’t (and based on my current inclusion logic thoughts, more confused about why it works for the others).
Thanks for the fix to be and sorry about the trouble.
Hi micsu,
It’s not a problem at all – it’s best we get this fixed! I think we are both just confusing eachother at the moment!
I have now updated it to use absolute file paths – can you please download the latest beta version and see if that fixes the issue for you?
All the best
The topic ‘Fatal error: Class 'ResponsiveMenu' not found in /var/www/html/wp-content/plugin’ is closed to new replies.