LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-23-2005, 12:00 PM   #1
bulletck
LQ Newbie
 
Registered: Dec 2005
Posts: 1

Rep: Reputation: 0
how does file dependencies work with symbolic linking?


Here is the set-up I have:

a directory called /blah
a directory called /blah/etc
an index.php file in /blah/etc where there is a require statement like so require("../file.php");

i have another directory called /sym and in there i create a symbolic link from /sym/etc to /blah/etc

when i try to visit /sym/etc in a browser it basically redirects me to /blah/etc and includes blah's file.php instead of reading sym's file.php.

How can I set things up so that /sym directory will try to find files relative to itself first and if it cant then read the file from /blah directory? So in /sym/etc/index.php there is a require for ../file.php and if it finds file.php in the root of /sym then it will read that file and if not then it will read /blah/file.php. Does this make any sense? Thanks in advance!
 
Old 12-23-2005, 09:22 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
If I understand you correctly, I don't think there's an easy way to do what you want. If you're in /sym/etc, then the parent directory is sym and it doesn't know anything about /blah. You could write a little routine in PHP to use the stat function to check if /sym/etc is a symlink, and if so check ehatever it points to for required files.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking Libraries, Dependencies Killbot_5000 Linux - Software 4 09-28-2004 08:59 AM
Symbolic linking directories leecming Linux - General 1 06-08-2004 11:11 AM
symbolic linking dvd-rom to /dev/dvd ? Falcon006 Linux - Newbie 3 03-20-2004 12:57 AM
symbolic linking directories? Possible? ajspliffs Linux - General 3 01-12-2004 11:55 AM
symbolic linking ???? salparadise Linux - Newbie 2 12-26-2002 12:01 PM


All times are GMT -5. The time now is 09:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration