2

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?

4

4 回答 4

4

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 “/”&gt;
Options -ExecCGI FollowSymLinks -Includes -IncludesNOEXEC -Indexes -MultiViews -symLinksIfOwnerMatch
AllowOverride All
</Directory>

May be different depending on your configuration.

于 2012-06-20T03:18:24.683 回答
2

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.

于 2012-06-20T03:19:12.143 回答
2

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.

于 2012-09-19T07:44:40.320 回答
0

I copied what Luke Pittman had posted, and modified what Codemole stated.

  1. Create your symlink in the htdocs folder (D:\xampp\htdocs)

mklink /J dynamic c:\somedirectory\www-dynamic

  1. 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

于 2018-08-30T07:36:14.667 回答