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