×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

problem with set_include_path

problem with set_include_path

problem with set_include_path

(OP)
The problem may not be with PHP at all but with me understanding what I am doing and how it is meant to be done! winky smile

I have this

CODE

set_include_path(
    __DIR__.'/'
    .PATH_SEPARATOR.
    __DIR__.'/include/'
    .PATH_SEPARATOR.
    __DIR__ . '/include/ar/'
    . PATH_SEPARATOR .
    __DIR__.'/include/ci/'
    .PATH_SEPARATOR.
    __DIR__.'/include/gl/'
    .PATH_SEPARATOR.
    __DIR__.'/include/in/'
    .PATH_SEPARATOR.
    __DIR__.'/include/pf/'
    .PATH_SEPARATOR.
    __DIR__.'/include/setup/'
    .PATH_SEPARATOR.
    __DIR__.'/include/so/'
    .PATH_SEPARATOR.
    __DIR__.'/ajax/'
    .PATH_SEPARATOR.
    __DIR__.'/ajax/setup/'
    .PATH_SEPARATOR.
    __DIR__.'/common/'
); 
which translates to

CODE

./:/home/name/public_html/name.com/:/home/name/public_html/name.com/include/:/home/name/public_html/name.com/include/ar/:/home/name/public_html/name.com/include/ci/:/home/name/public_html/name.com/include/gl/:/home/name/public_html/name.com/include/in/:/home/name/public_html/name.com/include/pf/:/home/name/public_html/name.com/include/setup/:/home/name/public_html/name.com/include/so/:/home/name/public_html/name.com/ajax/:/home/name/public_html/name.com/ajax/setup/:/home/name/public_html/name.com/common/ 

I then use a simple

CODE

include_once('common.php'); 
which is a script found within

CODE

/home/name/public_html/name.com/common/ 

but I am getting an error

CODE

<b>Warning</b>:  include_once(common.php): failed to open stream: No such file or directory in <b>/home
/name/public_html/name.com/ajax/ajaxControl.php</b> on line <b>39</b><br /> 

What am I doing wrong?

I have never used this approach and just edited a lot of scripts - would hate to reverse my decision. sad

Thank you all in advance for your assistance!




--
SouthBeach
http://www.fp2php.com
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.

RE: problem with set_include_path

(OP)
Replaced __DIR__ with $_SERVER["CONTEXT_DOCUMENT_ROOT"] and that fixed the problem.

Of course, root cause is now obvious. winky smile

That being said, if my solution is NOT a real solution, please do advise.

--
SouthBeach
http://www.fp2php.com
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.

RE: problem with set_include_path

Quote:

That being said, if my solution is NOT a real solution, please do advise.


Knowing exactly what you ARE trying to do would help in determining that.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close