How can I change the target of a symlink with PHP? Thanks.
A:
PHP can execute shell commands using shell_exec
or the backtick operator.
Hence:
<?php
`rm thelink`;
`ln -s /path/to/new/place ./thelink`;
This will be run as the user which is running the Apache server, so you might need to keep that in mind.
nickf
2010-03-23 04:04:42
Shell commands should be avoided when there are built-in alternatives.
too much php
2010-03-23 04:10:17