#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2007
    Posts
    19
    Rep Power
    0

    Need some help with aliases and php


    I'm running oscommerce not that version matters on php 5.3 and apache 2.2 (centos 5.6)

    I have a store and all of the php code refers to the store images in /images directory and my store works fine.

    I have now cloned the store under a different name on the server and since my store contain over 12,000 images I do not want to make a copy of the images directory and would rather use an alias or symbolic link.

    my current images are in:
    /home/sites/store/web/images

    my cloned store is
    /home/sites/cloned-store/web and I'd like to create an images directory in the clone-store directory and have it point to :
    /home/sites/store/web/images


    what's the best way to accomplish this?
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Although theoretically you could use PHP for this, there doesn't seem to be much point. Just create a symlink to the directory.

    From a shell:
    Code:
    ln -s /home/sites/store/web/images /home/sites/cloned-store/web/images
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2007
    Posts
    19
    Rep Power
    0
    thanks I've done that but my I'm getting something strange.

    I created images in /home/sites/cloned-store/web/ first

    and now there's a directory called images under images in /home/sites/cloned-store/web/ (i.e. /home/sites/cloned-store/web/images/images that links to the other directory.

    how to I undo this and should I have NOT created an images directory in cloned first?

    thanks
  6. #4
  7. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Remove the web/images/images link using rm, and remove the web/images directory using rmdir. Don't create an images directory, just create a link.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2007
    Posts
    19
    Rep Power
    0
    Originally Posted by E-Oreo
    Remove the web/images/images link using rm, and remove the web/images directory using rmdir. Don't create an images directory, just create a link.
    thanks so much - that worked great!
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2007
    Posts
    19
    Rep Power
    0
    Originally Posted by jjj0923
    thanks so much - that worked great!
    one final question - is this link permanent - as in....if I reboot the server does the link persist?
  12. #7
  13. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Yes
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo