Symbolic Links are kicking my butt!

This is a discussion on "Symbolic Links are kicking my butt!" within the PHP Forum section. This forum, and the thread "Symbolic Links are kicking my butt! are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 16th, 2007, 05:30
Reputable Member
Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 233
Thanks: 4
Thanked 0 Times in 0 Posts
Symbolic Links are kicking my butt!

Please help! I'm losing my mind on this!!!

Here's my code for creating a symlink:
PHP: Select all

$symlink "smokescreen/abcd12345678.wma";
$truelink "uber/top/secret/dir/007/19571083.wma";
symlink($truelink$symlink);
echo 
"<a href='$symlink'>sym link</a><br>";
echo 
"<a href='$truelink'>true link</a>"
When I load that file, the true link works, but the sym link gives me a 404. When I ftp into the smokescreen directory, I can see that the symlink is there. Smokescreen dir and all files in it are set to "777". Not sure what the permissions are for top secret dir, but the true link works, so...?
Symlinks are there... Target files are there... Path is correct in href... Seems like everything should work...!?!?

If it helps solve the mystery, this code (for cleaning up symlinks) doesn't work, either. (The symlinks don't get deleted.)
PHP: Select all

$symdir "smokescreen/";
$d dir($symdir); 
while(
$file $d->read()) {
    if (
$file!= "." && $file!= "..") {
    
unlink($file);
    }
$d->close();

Is there some trick to using symlinks that only "made guys" know about?!
Reply With Quote

  #2 (permalink)  
Old Feb 16th, 2007, 18:29
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Symbolic Links are kicking my butt!

What are your Apache options set to in httpd.conf? Have you set SymLinksIfOwnerMatch or FollowSymLinks on, or set All?

See the Options directive under http://httpd.apache.org/docs/2.0/mod/core.html for a full description.
Reply With Quote
  #3 (permalink)  
Old Feb 16th, 2007, 20:19
Reputable Member
Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 233
Thanks: 4
Thanked 0 Times in 0 Posts
Re: Symbolic Links are kicking my butt!

I don't think I have access to any of that. (Hosting via 1and1.com.)

The good news is, I switched to hard links and now everything is working. Still curious about why link() works, but symlink() doesn't, though.

Thanks for the response, grahame!
Reply With Quote
  #4 (permalink)  
Old Feb 17th, 2007, 03:28
Reputable Member
Join Date: Jul 2005
Location: Melksham, Wilts, UK
Posts: 293
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Symbolic Links are kicking my butt!

There is a security issue with Symlinks which can provide a route through which unexpected areas of the computer's file systems can be served when adminstered by a web admin whos' unaware. Hard links aren't as flexible in how they graft different parts of the file system. On 1and1, the bigger accounts / setups (e.g. dedicated servers) do give you control, but I don't thinks the basic one do.
Reply With Quote
  #5 (permalink)  
Old Feb 20th, 2007, 13:50
masonbarge's Avatar
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Symbolic Links are kicking my butt!

Donny - What OS does your server use?
Reply With Quote
  #6 (permalink)  
Old Feb 23rd, 2007, 04:29
Reputable Member
Join Date: Mar 2005
Location: Margaritaville (a state of mind somewhere between Inebriation and San Diego), CA
Posts: 233
Thanks: 4
Thanked 0 Times in 0 Posts
Re: Symbolic Links are kicking my butt!

Quote:
Originally Posted by masonbarge View Post
Donny - What OS does your server use?
It's some flavor of Linux, not sure which distro or version. My account doesn't include shell access, so I suppose I'd have to inquire of their support department. In light of recent (horrific) experiences with them, it would not be worth the headache to do so.
Reply With Quote
Reply

Tags
symbolic links, symlink, symlinks

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PR4 links for sale...links in an excellent position agent14 Link Building and Link Sales 1 Mar 5th, 2007 21:33
The Water Butt Shop hart084 Free Web Site Critique 2 Jan 29th, 2007 12:16
Kicking myself... hard! Pherdnut Introduce Yourself 9 Nov 19th, 2006 06:01
Blured Links (image links) bruno89 Web Page Design 2 Jul 25th, 2006 14:48
Different coloured links without modifying links? Webforumz Staff Web Page Design 12 Aug 29th, 2003 18:48


All times are GMT. The time now is 06:49.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43