I'm having trouble accessing a PHP page on my server through a symbolic link created as follows:
ln -s test.php clone/test.php
When I try to access the page, I get a 403 error.
Also, when I have checked created symlink in FTP, it shows folder icon there. (Though this wont be so big issue anyway.)
So simply I hope I could access clone/test.php
through web browser. Is not there any good way to do this?
Finally I have figured it out. When I tried with FULL PATH for source path, it works okay.
So when to create a symlink, it seems we have to put Full Physical Path for source file to which the symlink will link.
Tricky one. You'll need to either edit an .htaccess file similar to the following:
Options +FollowSymLinks +SymLinksIfOwnerMatch
Or use a httpd.conf file:
<Directory “/”>
Options -ExecCGI FollowSymLinks -Includes -IncludesNOEXEC -Indexes -MultiViews -symLinksIfOwnerMatch
AllowOverride All
</Directory>
May be different depending on your configuration.
You're probably running into the symbolic link permissions error that only happens on Unix. Make sure that the Apache user (I'm assuming this is Apache) has access to the file pointed to, as well as every directory above it.
You'll also need to enable FollowSymLinks
on your directory if you haven't already, as @LukePittman points out.
I copied what Luke Pittman had posted, and modified what Codemole stated.
mklink /J dynamic c:\somedirectory\www-dynamic
Then alter your httpd.conf to allow execute access for php pages
Options ExecCGI FollowSymLinks Includes IncludesNOEXEC Indexes MultiViews symLinksIfOwnerMatch AllowOverride All
Luke's solution just needs to loose the dashes "-". Before that, Apache wouldn't start up. Apache: Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.0.22