春节过后的第一篇文章,mac电脑的xampp

12661次浏览

大家新春快乐,春节之后的第一篇文章。也是用苹果电脑写的第一篇博客。

最近新入了一台苹果笔记本,用起来还不是很习惯。这几天摸得差不多了,但是也遇到了不少小问题。下面总结一下!

mac上的xampp出现Access forbidden!

xampp安装成功之后,有的程序可以在localhost中运行,有的却报如下问题:

Access forbidden!  You don’t have permission to access the requested object. It is either read-protected or not readable by the server.

解决办法:

可以找到apache的httpd.conf文件,找出

<Directory />
    Options All
    AllowOverride All
    Order deny,allow
    Allow from all
</Directory>

如果还不行,那就是权限的问题了

在命令中运行如下命令

chmod -R 777 /Applications/XAMPP/xamppfiles/htdocs

就可以了。

mac上的xampp中的mysql无法启动

网友办法:

在电脑终端输入这个

sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start

但是每次都要重新输入,可以尝试如下方法:

sudo vim /Library/LaunchDaemons/com.mysql.mysql.plist

然后输入

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>KeepAlive</key>
    <true/>
    <key>Label</key>
    <string>com.mysql.mysqld</string>
    <key>ProgramArguments</key>
    <array>
    <string>/usr/local/mysql/bin/mysqld_safe</string>
    <string>--user=mysql</string>
    </array>  
  </dict>
</plist>

然后执行

sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysql.plist

问题解决!

Tags: macxampp

相关文章: