Get blog id of subdirectory multisite blog from name – *outside* of wordpress request processing

Looks like I get to answer my own question.

It turned out the problem wasn’t in anything that wordpress was doing, but rather in the way I integrated it with the Zend application at a higher level than the code shown in the question. That code in itself worked fine and did not cause Apache to crash.

The problem was that in the initial integration with the Zend MVC application, I only considered running wordpress queries that could access the MVC application’s functions and database. To do that, my first-run must-use plugin ran the bootstrap for the Zend application. But then when I needed to access wordpress functionality from the Zend application, I didn’t prevent the Zend bootstrap from running twice (once in setting up for the MVC request, and a second time in the initial must-use plugin for wordpress).

Preventing the Zend application bootstrap from running twice in the same request (using define/defined) fixed the apache crash, and now the posted code works fine. Since I’m certain I’m not the only person integrating wordpress with a Zend Framework MVC application, I thought I should post this detailed answer.