Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a project with a directory structure that relies on symlinks. I would like to package this project in such a way that users with no command line access or knowledge could still upload the project to their servers. At the moment, this is not possible, whenever I attempt to upload the symlinks, they are converted into the contents they link to.

Is it actually possible to upload symlinks to a server? If yes, what would be the procedure? If not can you recommend another approach?

This project wouldn't work without symlinks as I need the same information in various places and copying the content is not an option.


share|improve this question
up vote 1 down vote accepted

Besides the suggestions from Dennis you could look at tar or cpio and then use a self-extracting shell script to make it easier on the end user to install.

Look up here-to (>>) documents under any bash scripting tutorial or try MakeSelf.

share|improve this answer
Thanks, this may be the answer actually!... In the meantime, I also found out that I may be able to use the symlink() PHP function , all the symlinks are relative links – slimbuddah Sep 15 '09 at 22:56
You could then package up everything into a tar archive with all symlinks in place, then create a PHP page that "installs" the application for them. You could then add some branding to the PHP page so that the users feel like it is a polished installer – Wayne Sep 16 '09 at 3:04

How are you uploading?

rsync can copy symlinks, if that's an option that's available to you.

Could your users run a script to create the symlinks?

share|improve this answer
Nope, I have to assume the users have minimum knowledge... – slimbuddah Sep 15 '09 at 22:53

To expand on Dennis Williamson's answer:

You're using FTP to upload. FTP doesn't support symlinks.

FTP is also unadvisable for other reasons.

Supporting uploading through ssh instead will get rid of your problem. E.g. you will be able to use rsync.

share|improve this answer
Personally I use SFTP, but I would expect some users to use FTP... For my own use, I'd just create the symlinks on the server , but I can't expect users to have command line access – slimbuddah Sep 15 '09 at 22:52

If your project is a PHP application and we assume that the worst case scenario of installation target is some unix webhotel with PHP that has all safe features on, there really is no way to execute/run some installation script on the server.

Best option is probably to have a PHP-page that will create the required links with symlink() or link(). Either hardcode them into the PHP-page or write a simple script that will read simple configuration file.

share|improve this answer
Yes, the project is a PHP application. This sounds like the solution to me, although I may also try the self-extracting shell script and leave the option to the user – slimbuddah Sep 16 '09 at 6:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.