1

I picked up a site from another designer and it's all php, which I only know a tiny bit of from working with wordpress.

Here's my issue, I click on a link that is suppose to open up a page of photos on the site, but instead of getting the page: www.willowbeach.com/our-cottages-photos.php enter image description here I get this:

Warning: require(/home/willowbe/public_html/db/db_class.inc.php): failed to open stream: No such file or directory in /hermes/bosnaweb19a/b512/nf.burlingtonchocolatet/public_html/willowbeach/db/application_top.php on line 14 Fatal error: require(): Failed opening required '/home/willowbe/public_html/db/db_class.inc.php' (include_path='.:/usr/local/lib/php-5.5.22-amd64/lib/php') in /hermes/bosnaweb19a/b512/nf.burlingtonchocolatet/public_html/willowbeach/db/application_top.php on line 14

I know it has to do with the fact that the path is a local system one and not the web directory path. But I have no clue where to go to fix this. Any help would be much appreciated.

Ahmed farag mostafa
  • 2,802
  • 2
  • 14
  • 33
ablesonh
  • 11
  • 2
  • Possible duplicate of [Failed to open stream : No such file or directory](http://stackoverflow.com/questions/36577020/failed-to-open-stream-no-such-file-or-directory) – Vic Seedoubleyew May 05 '16 at 19:10

1 Answers1

1

If you read the error carefully, it tells you exactly where to go and what PHP was trying to do:

PHP was attempting to run

require(/home/willowbe/public_html/db/db_class.inc.php)

Which is located at

/hermes/bosnaweb19a/b512/nf.burlingtonchocolatet/public_html/willowbeach/db/application_top.php

on line 14.

It could not locate the file there, thus the error.

Now, putting this website into a complex directory tree like /hermes/bosnaweb19a/b512/nf.burlingtonchocolatet/public_html/willowbeach seems unecessarily complex to me, but I'm sure you had reasons to put it there.

Starting at application_top.php on line 14, you have to find all full path references to /home/willowbe/public_html/ and replace them with /hermes/bosnaweb19a/b512/nf.burlingtonchocolatet/public_html/willowbeach/ so the files are found by php.

Digital Chris
  • 6,177
  • 1
  • 20
  • 29
  • Okay so when I pull up application_top.php I get this: # Session session_start(); require('config.php'); # DB Connection require(DIR_FUNCTION.'db_class.inc.php'); $db = new db_mysql(DBHOST,DBUSER,DBPASS,DBNAME); $db->connect(); $db->select_db(); require(DIR_FUNCTION.'db_class.inc.php'); is the 14th line – ablesonh May 03 '16 at 00:37
  • So you need to find where `DIR_FUNCTION` is defined and point it to the right place.... – Digital Chris May 03 '16 at 14:09