下载不带vm的那个xammp
https://www.apachefriends.org/download.html
1./Applications/XAMPP/xamppfiles/etc httpd.conf vhosts.conf 的注释放开# 2.extra/httpd-vhosts.conf <VirtualHost *:80> ServerAdmin dev.daishutijian.com DocumentRoot "/opt/tijian" ServerName dev.daishutijian.com ErrorLog "logs/dummy-host.example.com-error_log" CustomLog "logs/dummy-host.example.com-access_log" common </VirtualHost> 3.sudo vi /etc/hosts xammp里面的数据库不能启动,把mac偏好设置里面自带的数据库给停掉 进入数据库 /Applications/XAMPP/bin/mysql -u root -p 修改密码
use mysql UPDATE user SET Password=PASSWORD('root') WHERE user='root';
FLUSH PRIVILEGES;