apache thinkphp5 第一次配置

完成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)

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值