Is the Component Manager in Magento 2 A Real Thing, or a Tech Demo?
There is a really nice derivation of this identity using differential forms, and it completely avoids all the messiness of the Christoffel symbols.
The nice thing about differential forms is that the exterior derivative can be computed using any derivative operator, so it allows us to compare the expressions we get using the covariant derivative to the expression you would get using partial derivatives.
Treating $\phi$ as a 0-form, we are going to compute $*d*d\phi$. Doing it with covariant derivatives will reproduce $\nabla_a \nabla^a \phi$, while with partial derivatives we will get the formula involving $\sqrt{-g}$:
\begin{align} *d*d\phi &= \frac{1}{4!}\epsilon_{abcd}\cdot4\nabla^{[a}\epsilon^{|e|bcd]}\nabla_e\phi \\ &=\frac{4}{4!}\epsilon_{abcd}\epsilon^{ebcd}\nabla^a\nabla_e\phi\\ &=\frac{4\cdot 3!}{4!}(-\delta^e_a)\nabla^a\nabla_e\phi \\ &=-\nabla_a\nabla^a\phi \end{align}
We used that the covariant derivative of the $\epsilon$ tensor is zero, and also the fact that when you contract indices of two $\epsilon$ tensors you get a generalized Kronecker delta. The minus sign comes from the fact that $\epsilon$ is normalized with a factor of $\sqrt{-g}$, whereas when you raise all the indices of the epsilon tensor with an inverse metric you get an overall factor of $g^{-1}$, so $\dfrac{\sqrt{-g}}{g} = -\dfrac{1}{\sqrt{-g}}$.
Now we do the same thing using partial derivatives, and using the normalization of the $\epsilon$ tensor, $\epsilon_{abcd} = \sqrt{-g}\tilde{\epsilon}_{abcd}$, where $\tilde{\epsilon}_{abcd}$ is the alternating symbol, with values of $+1$, $-1$ or $0$ (and hence has vanishing partial derivatives).
\begin{align} *d*d\phi &=\frac{1}{4!}\epsilon^{abcd}\cdot4\partial_{[a}(\epsilon_{|e|bcd]}\partial^e\phi)\\ &=\frac{4}{4!}\frac{-1}{\sqrt{-g}}\tilde{\epsilon}^{abcd}\partial_a(\sqrt{-g}\tilde{\epsilon}_{ebcd}g^{ef}\partial_f\phi)\\ &=-\frac{4\cdot3!}{4!}\delta^e_a\frac{1}{\sqrt{-g}}\partial_a(\sqrt{-g})g^{ef}\partial_f\phi)\\ &=-\frac{1}{\sqrt{-g}}\partial_a(\sqrt{-g}g^{af}\partial_f\phi) \end{align} Hence, we see why the two expressions are equal: it is intimately connected with the differential forms description of this operator.
For differential forms of rank $1$ or greater, the operator $\nabla_a\nabla^a$ is related to the Laplace-Beltrami operator $\triangle = *d*d+d*d*$, but is not exactly equal to this; the difference of the two operators is proportional to the curvature tensor. However, the analog of the derivation above can be derived for a differential $p$-form $\alpha$, with the operator $*d*$, i.e. $$\nabla_{a_1} \alpha^{a_1\ldots a_p}= -*d*\alpha = \frac{1}{\sqrt{-g}}\partial_{a_1}\left(\sqrt{-g} \alpha^{a_1\ldots a_p}\right)$$
And, as others have mentioned, the derivation does not rely on the equations of motion, and hence holds off-shell.
I believe they are the same from brief look at the code:
AP_DECLARE(void) ap_init_vhost_config(apr_pool_t *p)
{
...
}
/* Parses a host of the form <address>[:port]
...
Then:
if (strcmp(host, "*") == 0) {
rv = apr_sockaddr_info_get(&my_addr, "0.0.0.0", APR_INET, port, 0, p);
...
else {
rv = apr_sockaddr_info_get(&my_addr, host, APR_UNSPEC, port, 0, p);
So it looks like * just gets parsed to 0.0.0.0 in this instance, and if it actually is 0.0.0.0
it will get passed as such (Although maybe APR_INET vs. APR_UNSPEC matters, but I think that might just be IPv compatibility thing, so maybe there is a difference in that IPv4 when 0.0.0.0 and IPv6 is possible when *, not sure). But I could be interpreting this totally wrong, you can see for yourself in server/vhost.c
.