Apache 不会遵循 Windows 403 禁止的符号链接

Apache 不会遵循 Windows 403 禁止的符号链接

我发现了许多类似的问题,但只针对 Linux,它们没有解决我的问题。我所做的是:

<VirtualHost *:80 *:443>
        ServerAdmin webmaster@localhost
        ServerName coreshop_demo.local

        DocumentRoot "D:/creation/software developer/projects/2021-coreshop-payment/web"
        <Directory />
                Options Indexes FollowSymlinks MultiViews
                Require all granted
                AllowOverride all
        </Directory>

        ErrorLog logs/coreshop_demo.local/error.log
        CustomLog logs/coreshop_demo.local/access.log combined
        LogLevel warn
        
        AddHandler application/x-httpd-php .php
        AddType application/x-httpd-php .php .html
        
        php_value display_errors "Off"
        php_value display_startup_errors "Off"
        php_value log_errors "On"
        
</Virtualhost>

我使用类似的东西创建符号链接D:\creation\software developer\projects\2021-coreshop-payment\web\bundles> mklink /D "pimcorecore" "../../vendor/pimcore/pimcore/bundles/CoreBundle/Resources/public/,因此../../vendor不在web目录中。

当我尝试访问文件时,我得到了403 forbiddenPHP 错误日志,类似于invalid file or directory path syntaxApache 错误代码:AH00127

知道如何修复这个问题吗?

答案1

我猜问题在于vendor目录不在文档根目录内,并且 Apache 内部存在某种错误,不允许访问它。我对此无能为力,我宁愿使用一种解决方法。我删除了符号链接并将 Alias 添加到虚拟主机配置中。

<VirtualHost *:80 *:443>
        ServerAdmin webmaster@localhost
        ServerName coreshop_demo.local

        DocumentRoot "D:/creation/software developer/projects/2021-coreshop-payment/web"
        <Directory />
                Options Indexes FollowSymlinks MultiViews
                Require all granted
                AllowOverride all
        </Directory>

        Alias "/bundles/pimcoreadmin" "D:/creation/software developer/projects/2021-coreshop-payment/vendor/pimcore/pimcore/bundles/AdminBundle/Resources/public/"

        ErrorLog logs/coreshop_demo.local/error.log
        CustomLog logs/coreshop_demo.local/access.log combined
        LogLevel warn
        
        AddHandler application/x-httpd-php .php
        AddType application/x-httpd-php .php .html
        
        php_value display_errors "Off"
        php_value display_startup_errors "Off"
        php_value log_errors "On"
        
</Virtualhost>

相关内容