I'm not completely sure what you exact situation is. There is probably a simple fix to make that include work. That fix will probably be provided in another answer.
Instead, I'm going to offer you a best-practice
(Well, maybe not 'best', but a good practice):
In the first file you call, or your configuration file, define a constant that is the path to the first directory your files are contained in.
So if you are working in /home/user/domains/test.com/
:
DEFINE('SITE_PATH', '/home/user/domains/test.com/');
Then, whenever you include something, use that as a starting place
include(SITE_PATH . "lib/test.class.php");
This will make sure that PHP uses the full path to the file, and you don't have to worry about including the file relatively.
This is very helpful when you are changing files locations, as you don't have to change the includes when you move the file including everything.