关于 php:access files on laravel storage access 被 apache 禁止 | 珊瑚贝

access files on laravel storage access forbidden by apache


我正在尝试使用 laravel 存储 API。我可以在 storage/app/users/user_id/filename 上创建目录并保存文件,但是当我想使用网页上的文件时,我被禁止 403。我创建了一个符号链接:

1
ln s storage/app/users public/users

我检查了所有权限,它们都很好。我将所有权限更改为 777,但没有任何改变。这是我对此虚拟服务器的 apache 配置:

1
2
3
4
5
6
7
8
9
10
11
<VirtualHost *:80>
    ServerName kamel.dev
    DocumentRoot“/home/morteza/development/repo/kamel/public”
    <Directory /home/morteza/development/repo/kamel/public>
        AllowOverride All
        Options FollowSymlinks
        Order allow,deny
        Require all granted
        Allow from all
    </Directory>
</VirtualHost>

我使用文件时的 Chrome 错误消息:

GET http://kamel.dev/users/2/phpDiLp1O.jpg 403 (Forbidden)

这是直接调用 url 的 apache 响应:

Forbidden

You don’t have permission to access /users/2/phpDiLp1O.jpg on this
server.


问题在于我如何制作符号链接。这是创建符号链接命令:

1
cd public

进入公共目录后使用:

1
ln s ../storage/app/users users
  • 这是一个linux命令,我认为你需要为windows创建一个快捷方式


来源:https://www.codenong.com/38281776/

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_9192.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?