无法访问 .htaccess;打开的文件太多

Can't access .htaccess; Too many open files

最近安装了 phpStorm 和 xDebug。 随机出现以下错误,导致我的开发页面无法加载:

Forbidden
You don't have permission to access /admin/subscription/add/16603 on this server.
Server unable to read htaccess file, denying access to be safe

tail -f /var/log/apache2/error_log 显示:

24)Too many open files: [client 127.0.0.1:54206] AH00529:         /Users/jeshuadunham/Sites/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/Users/jeshuadunham/Sites/' is executable, referer: http://dev2.evesun.com/blog/

大约 30 秒后,刷新正常。

显然这是 xdebug 中的错误。

http://bugs.xdebug.org/view.php?id=1070

解决方法如下:

The workaround I use is to turn off autostart:

xdebug.remote_autostart = 0

Then in Firefox install the Add-on called The Easiest XDebug

In PHPStorm turn on the listener when you want to debug. It won't break unless you click the bug icon in the Firefox toolbar. You might get some errors if you leave the listener on in PHPStorm so turn it off when you're not using it.