Author Topic: PHP: include the '/' directory in files not permitted!  (Read 1422 times)

Offline Darlyn

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
PHP: include the '/' directory in files not permitted!
« on: March 02, 2006, 08:35:40 PM »
I am making bmsnewspaper.t35.com. I am using the

<?php include("top.inc") ?>

in order to make the entire site dynamic. I am putting an include (.inc file) into every page that way the function works. Well, since I am doing a page in another directory other than the /, the I would have to put:

<?php include("/top.inc") ?>

When I view the page on my browser, this message comes up:

Warning: main(): open_basedir restriction in effect. File(/top.inc) is not within the allowed path(s): (/home/freehost/scripts/:.) in /home/freehost/t35.com/b/m/bmsnewspaper/editions/janfeb.php on line 1

Warning: main(/top.inc): failed to open stream: Operation not permitted in /home/freehost/t35.com/b/m/bmsnewspaper/editions/janfeb.php on line 1

Warning: main(): Failed opening '/top.inc' for inclusion (include_path='.:/usr/local/lib/php') in /home/freehost/t35.com/b/m/bmsnewspaper/editions/janfeb.php on line 1


So that means that I will only be able to make pages in the / directory would be dynamic. Why is the / not allowed when I put it in the inclue function?

Please help,
Darlyn

P.S: An example of this is on http://bmsnewspaper.t35.com/editions/janfeb.php, because it is in another sub-directory and not in /. But http://bmsnewspaper.t35.com/index.php doesnt have this problem since its in the / directory.

Helping Webmasters - Webmaster Forum, Website Support and T35 Hosting Support

PHP: include the '/' directory in files not permitted!
« on: March 02, 2006, 08:35:40 PM »

Offline central

  • Newbie
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: PHP: include the '/' directory in files not permitted!
« Reply #1 on: January 13, 2012, 03:20:38 AM »
he path you entered, is too long. Enter a shorter path. You can read more here: http://longpathtool.com/ .
You will Fix filename too long, filename is too long, too long path and path too long problems forever.