Jump to content

Class not found when using require


ukweb

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.