Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Daniel1836's avatar

Help me resolve this issue (from the error log) OOP PHP

I'm trying to run an OOP PHP app on my host site.

The error log says this

require_once(lib/Job.php): failed to open stream: No such file or directory in ...etc path...

So I think the issue is with this line in my init.php file

require_once 'lib/'.$class_name. '.php';

Could the issue be with my relative path? The lib directory is one level up.

Thanks

0 likes
2 replies
MarianoMoreyra's avatar

Hi @daniel1836

If you say lib directory is one level up, have you tried with:

require_once '../lib/'.$class_name. '.php';

Please or to participate in this conversation.