LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-01-2007, 03:31 PM   #1
Parcye
LQ Newbie
 
Registered: Nov 2005
Location: Eindhoven
Posts: 3

Rep: Reputation: 0
Symlink to share code not working


Hi,

I am starting a project, that will consist of same custon code and some general code. The general code will be used for different instances of the project.

A short example:
I have webshop code, in the folder user/www/shop
I have custom code in the user/www folder

I don't want to have many copies of the shop folder, I basicly want the folder shop to point to one instance of the code.

A php script with includes, located in the general shop folder /mycode/shop/ can not include the files in its root folder because root is not /home/user1/www/ but /mycode .

My question is: how can I use the same code in different user directories without having to have multiple copies.

I hope the question is clear.
 
Old 02-01-2007, 05:01 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Put the shop code in a location accesible to all users. Then create a symlink in the user's dir pointing to the general code. Should work fine.
 
Old 02-02-2007, 02:05 AM   #3
Parcye
LQ Newbie
 
Registered: Nov 2005
Location: Eindhoven
Posts: 3

Original Poster
Rep: Reputation: 0
That is what I had, but it does not work fine.

Because when the shop code wants to include a user config file, by doing 'include ("../config.php");' it does not go to the users dir with '..' but goes up to the root of the shop dir.

/home/user1/www/shop/ -> /mycode/shop/
/home/user1/www/config.php
/home/user1/www/readme.txt

/mycode/shop/index.php
/mycode/readme.txt

if the index.php in the shop dir does a include of ../readme.txt it will include the readme in the mycode dir, not in the user1/www dir . If I do an include of config.php it will just fail saying that no config.php is found.
 
  


Reply



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
why isn't this php symlink script working verbatim Programming 8 04-27-2005 09:13 AM
public share not working with XP RyanB Linux - Networking 10 10-15-2004 06:23 PM
Share programming code, Instant Message firefly2442 Programming 7 09-26-2004 11:42 PM
howto: MAke a symlink to a samba share??? trey85stang Mandriva 1 03-14-2004 05:43 PM
Java plugin Symlink not working? Davin Linux - Software 4 02-07-2004 07:08 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:59 AM.

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
Open Source Consulting | Domain Registration