我是靠谱客的博主 想人陪蜗牛,这篇文章主要介绍apache thinkphp5 第一次配置scandir(/var/www/html/tp5/public/../application/extra): failed to open dir: Permission denied,现在分享给大家,希望可以做个参考。

完成lamp

https://blog.csdn.net/hongxiao2016/article/details/102721791

之后

开始thinkphp5第一次配置了

在/etc/apache2/sites-available中建立一个文件:

cp 000-default.conf tp5.com.conf

修改为:

...
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	ServerName tp5.com

	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/html/tp5/public
        <Directory "/var/www/html/tp5/">
  	  AllowOverride All
	</Directory>      

	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.......

 创建软链接使其生效

ln -s /etc/apache2/sites-available/tp5.com.conf /etc/apache2/sites-enabled/tp5.com.conf

添加hosts文件

127.0.0.1 tp5.com

之后会报错

You don't have permission to access this resource.Server unable to read htaccess file, denying access to be safe

需要给它执行权限:

 chmod +x -R /var/www/html/tp5/

再次访问

scandir(/var/www/html/tp5/public/../application/extra): failed to open dir: Permission denied

没有打开文件的权限

chmod 755 -R /var/www/html/tp/

终于完成了。。。

其实几乎都是权限问题

还有一点配置完成需要重启apache(service apache2 restart)

最后

以上就是想人陪蜗牛最近收集整理的关于apache thinkphp5 第一次配置scandir(/var/www/html/tp5/public/../application/extra): failed to open dir: Permission denied的全部内容,更多相关apache内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(35)

评论列表共有 0 条评论

立即
投稿
返回
顶部