Question: I have a class, its located in `/some/path/Class.php` for example. Now I want to create an object of this class.

I tried that, but it did not work:

```
$obj = new some/path/Class();

```

I also tried to include the class be fore and to create the object the normal way, like this:

```
include('/some/path/Class.php');
$obj = new Class();

```

Throws an error, too. How can I create an object of that class?

Answer: 
The include method you are using is correct, the problem seems to be the pathing to the file.

So you can either use relative pathing from the file you're calling it from:

```
include 'some/path/class.php';

```

Or use the full path:

```
include '/absolute/root/full/path/class.php';

```

To find out the full path, you could upload a simple PHP file with:

```
echo phpinfo(); 

```

then search on that page for 'SCRIPT\_FILENAME' and that will show you the absolute path the current file is running from on the server.
```
include('/some/path/Class.php');

```

This will start looking in the root folder, so you would have to supply the full path to the file which obviously doesn't make sense.

Use something like 

```
dirname(__FILE__)

```

to use a relative path. You might also want to declare a constant in your index.php (or in another file that gets autoloaded) that contains the base path of your application and then use that instead.