How can I change the purpose of a symlink in PHP? Thanks.
You can delete the existing link using unlink and recreate the link to the new target using symlink .
symlink($target, $link); . . unlink($link); symlink($new_target, $link);
You need to perform error checking for each of them.
PHP can execute shell commands using shell_exec or backtick operator .
shell_exec
Consequently:
<?php `rm thelink`; `ln -s /path/to/new/place ./thelink`;
This will be executed as the user who starts the Apache server, so you may need to keep this in mind.
Source: https://habr.com/ru/post/1304837/More articles:What is the difference between INSTEAD OF and AFTER trigger in SQL Server? - sql-serverSoftware Sector Sizes - language-agnosticWhere can I get streaming (live) video and audio from the application for the example camera for Android? - javaSSL Configuration - ruby-on-railsHow does the Android Market protect my application from distribution? - androidHow to reach Bing cards like InfoWindow on Google Maps? - javascriptJQuery API Help - jqueryMySQL The choice of the number of days "Days". - sqlThe font family name from the font file is c #Mono vs. .NET Interop Curiosity - unixAll Articles