0

I'm trying to build myself a website using PHP and MySQL. I get the below error:

Fatal error: require_once(): Failed opening required '/home/konjam /public_html/demo/cp/db.php' (include_path='.:/Applications/XAMPP/xamppfiles /lib/php') in /Applications/XAMPP/xamppfiles/htdocs/KD/demo/cat_details.php on line 5

Here's my code for the line where it says this specific error:

<?php
ob_start();
session_start();
require_once("conf.php");
require_once("db.php");
$db = new db();
?>

Any help guys?

bcesars
  • 1,016
  • 1
  • 17
  • 36

2 Answers2

3

Maybe it'll surprise you but there is no /home/konjam/public_html/demo/cp/db.php file and PHP can't include it in your code.

Make sure you specify correct path to that file (maybe use dirname(__FILE__) and relative path?) and that PHP have rights to read it.

Elon Than
  • 9,603
  • 4
  • 27
  • 37
0

the application is taken from a linux machine and put on a windows machine, in XAMPP. you have to search for all "/home/konjam/public_html" strings in your project folder in xampp and modify the references properly, from linux to windows. It would be best to work with relative paths.