0

I am trying to include the File from the above folder . Iam here (www/pf/htdocs/ap) . I want to include a php file from the above www it is dev/libraray/hp.php

i am doing it in this way include_once ('../../../../dev/libraray/hp.php') but could not do it How could i do it

3 Answers 3

2
  1. Be sure that target path is readable by PHP interpreter (can be read by user running it).
  2. If so, play with the "../" path, adding or substracting it from the include() string. for this one, removing it once should fix the problem, because you need to go 3 levels down:

include_once ('../../../dev/libraray/hp.php')

Sign up to request clarification or add additional context in comments.

Comments

0

Use the actual server directory path.

ex. include('/home/username/include.php');

Comments

0

You should use something like $_SERVER['DOCUMENT_ROOT'] in case you change the locations and folders or define a base path like define('BASE_URL', dirname($_SERVER["file_name"]));

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.