Try this
<?php
include __DIR__ . '/includes/parentclass.int.php';
include __DIR__ . '/includes/newclass.int.php';
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
working with plain php. and I have php files in My includes folder like this,
newclass.int.php
<?php
class NewClass extends ParentClass {
}
?>
parentclass.int.php
<?php
class ParentClass{
public $name = "Hey There!";
}
?>
and index.php like this,
<?php
include 'includes/parentclass.int.php';
include 'includes/newclass.int.php';
$object = new NewClass;
?>
<html>
<head>
<title>oop php</title>
</head>
<body>
<?php
echo $object->name;
?>
</body>
</html>
but I got following error msg when running the server,
include(includes/parentclass.int.php): failed to open stream: No such file or directory in C:\wamp64\www\ooptest\index.php on line 2
Warning: include(includes/newclass.int.php): failed to open stream: No such file or directory in C:\wamp64\www\ooptest\index.php on line 3
Fatal error: Uncaught Error: Class 'NewClass' not found in C:\wamp64\www\ooptest\index.php on line 4
Error: Class 'NewClass' not found in C:\wamp64\www\ooptest\index.php on line 4
how can I fix this problem?
Please or to participate in this conversation.