2

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.

Thanks!!!

4 Answers 4

1

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.

2
  • 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, 2009 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, 2009 at 3:04
1

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?

1
  • Nope, I have to assume the users have minimum knowledge...
    – slimbuddah
    Sep 15, 2009 at 22:53
1

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.

1
  • 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, 2009 at 22:52
1

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.

1
  • 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, 2009 at 6:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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