ukweb Posted April 26, 2012 Share Posted April 26, 2012 Hi This is a strange one, and I'm not sure whats going on here. I've tried googling the answer to no avail. Basically, I'm writing a Wordpress plugin, and here's my setup: install.php has a class called 'two_install' The main plugin file code snippet: // Installation require(plugin_basename('installer.php')); // Initiate installation class $twp_install = new twp_install; This results in this on activation: Fatal error: Class 'twp_install' not found in path-on-server\wp-content\plugins\twitter_parser\twitter_parser.php on line xx Anyone got any ideas? Just a note, there is definitely a class called 'twp_install' in installer.php! Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/261632-class-not-found-when-using-require/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 26, 2012 Share Posted April 26, 2012 I can think of at least 6 different things that would prevent a class definition from being seen in a file. If you want someone here to help determine why, you would need to post your installer.php file, showing the opening php tag through to the start of that class definition, especially since you implied two different spellings for the class name in your post. Quote Link to comment https://forums.phpfreaks.com/topic/261632-class-not-found-when-using-require/#findComment-1340652 Share on other sites More sharing options...
trq Posted April 26, 2012 Share Posted April 26, 2012 You also mention two different files install.php and installer.php, which is it? Quote Link to comment https://forums.phpfreaks.com/topic/261632-class-not-found-when-using-require/#findComment-1340654 Share on other sites More sharing options...
PFMaBiSmAd Posted April 26, 2012 Share Posted April 26, 2012 LOL Quote Link to comment https://forums.phpfreaks.com/topic/261632-class-not-found-when-using-require/#findComment-1340655 Share on other sites More sharing options...
ukweb Posted April 26, 2012 Author Share Posted April 26, 2012 Solved, schoolboy error, path to installer.php was wrong, and I didn't pick it up sooner because wordpress didn't return an error! Thanks for your replies. Quote Link to comment https://forums.phpfreaks.com/topic/261632-class-not-found-when-using-require/#findComment-1340674 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.