Created
January 14, 2026 06:10
-
-
Save fsuuaas/25c0e55e215430429355b442f7a6d75d to your computer and use it in GitHub Desktop.
Symlink.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Paths | |
| $target = '/home/username/public_html/storage/app/public'; | |
| $link = '/home/username/public_html/public/storage'; | |
| echo "<pre>"; | |
| // Check if link already exists | |
| if (file_exists($link)) { | |
| echo "❌ Link or folder already exists at:\n$link\n"; | |
| exit; | |
| } | |
| // Try to create symlink | |
| if (symlink($target, $link)) { | |
| echo "✅ Symlink created successfully!\n"; | |
| echo "Link: $link\n"; | |
| echo "Target: $target\n"; | |
| } else { | |
| echo "❌ Failed to create symlink.\n"; | |
| echo "Possible reasons:\n"; | |
| echo "- PHP does not have permission\n"; | |
| echo "- symlink() disabled by hosting provider\n"; | |
| } | |
| echo "</pre>"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment