开启虚拟主机配置include
sudo vim /opt/lampp/etc/httpd.conf
# Virtual hosts
Include etc/extra/httpd-vhosts.conf
编写虚拟主机配置
sudo vim /opt/lampp/etc/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerName www.test1.com
DocumentRoot /home/baloneo/PhpstormProjects/WechatPHP/public
<Directory "/home/baloneo/PhpstormProjects/WechatPHP/public">
DirectoryIndex index.html index.htm index.php
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
allow from all
Order allow,deny
</Directory>
</VirtualHost>
注意Require all granted
需要加上,不然会403
关闭已有的nginx等冲突服务
sudo systemctl stop nginx.service
设置tp的runtime目录为777
cd your/thinkphp/project/path
rm -rf runtime
mkdir runtime
chmod 777 runtime
网友评论