php 上级目录 权限,thinkphp require 上级目录提示没有权限,请问如何配置apache

网站使用了thinkphp5框架,服务器采用wdcp搭建的

然后将公共文件上传到了/website/public_html目录中

其他不可访问的框架文件放在了/website/目录中

但是当php require /website/目录中的一些类的时候,他会提示Failed opening required

估计是wdcp的设置导致没有权限

附上wdcp中apache的设置

DocumentRoot /www/web/website/public_html

ServerName new.website.com

ServerAlias new.website.com

ErrorDocument 400 /errpage/400.html

ErrorDocument 403 /errpage/403.html

ErrorDocument 404 /errpage/404.html

ErrorDocument 503 /errpage/503.html

php_admin_value open_basedir /www/web/website:/tmp

DeflateCompressionLevel 7

AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php

AddOutputFilter DEFLATE css js html htm gif jpg png bmp php

Options FollowSymLinks

AllowOverride All

Require all granted

请问大神如何解决,百度了也百度不到

回复内容:

网站使用了thinkphp5框架,服务器采用wdcp搭建的

然后将公共文件上传到了/website/public_html目录中

其他不可访问的框架文件放在了/website/目录中

但是当php require /website/目录中的一些类的时候,他会提示Failed opening required

估计是wdcp的设置导致没有权限

附上wdcp中apache的设置

DocumentRoot /www/web/website/public_html

ServerName new.website.com

ServerAlias new.website.com

ErrorDocument 400 /errpage/400.html

ErrorDocument 403 /errpage/403.html

ErrorDocument 404 /errpage/404.html

ErrorDocument 503 /errpage/503.html

php_admin_value open_basedir /www/web/website:/tmp

DeflateCompressionLevel 7

AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php

AddOutputFilter DEFLATE css js html htm gif jpg png bmp php

Options FollowSymLinks

AllowOverride All

Require all granted

请问大神如何解决,百度了也百度不到

require /website/明显不对,错误信息的意思也是这个目录根本不存在,这里要用相对路径或者/www/web/website。你看,你的apache配置都写了DocumentRoot /www/web/website/public_html。

如果一定想用绝对路径最好先执行一次 echo __DIR__,看看到底完整路径是什么。

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值