jsherk Posted June 20, 2007 Share Posted June 20, 2007 How do I create a symbolic in Linux from a PHP program, using the ln -s command? Here is the command line I would type, but I'm not sure how to call it from php... ln -s home/mydomain/files/file home/mydomain/public_html/files/file Thanks Quote Link to comment https://forums.phpfreaks.com/topic/56470-create-a-symbolic-in-linux-from-php/ Share on other sites More sharing options...
trq Posted June 21, 2007 Share Posted June 21, 2007 Either of.... exec('ln -s home/mydomain/files/file home/mydomain/public_html/files/file'); or link('ln -s home/mydomain/files/file', 'home/mydomain/public_html/files/file'); Quote Link to comment https://forums.phpfreaks.com/topic/56470-create-a-symbolic-in-linux-from-php/#findComment-278965 Share on other sites More sharing options...
jsherk Posted June 21, 2007 Author Share Posted June 21, 2007 Yes, thanks that got me on the right path, and I think I found what I need... The link() command is for hard links, but I want to create a soft link or symbolic link. The command is (obviously enough) symlink(), but I think it is only available on Linux. I found some good examples of it here: http://us2.php.net/manual/en/function.symlink.php Quote Link to comment https://forums.phpfreaks.com/topic/56470-create-a-symbolic-in-linux-from-php/#findComment-279043 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.