The $^{26}\mathrm{Si}(p,\ensuremath{\gamma})^{27}\mathrm{P}$ reaction might be relevant in understanding the $^{26}\mathrm{Si}$ depletion and $^{26}\mathrm{Al}$ production in stars. The asymptotic normalization coefficients (ANC) for the $^{26}\mathrm{Si}(p,\ensuremath{\gamma})^{27}\mathrm{P}$ reaction were extracted earlier from the reanalysis of $^{26}\mathrm{Mg}(d,p)^{27}\mathrm{Mg}$ and $^{26}\mathrm{Mg}(t,d)^{27}\mathrm{Mg}$ reactions, in which the deduced ANC's show significant discrepancies. In this work, a dedicated ($d,p$) measurement is presented: the ANC for the $^{27}\mathrm{Mg}\ensuremath{\rightarrow}\phantom{\rule{0.16em}{0ex}}^{26}\mathrm{Mg}+n$ virtual decay is deduced from the $^{26}\mathrm{Mg}(d,p)^{27}\mathrm{Mg}$ reaction populating the ground and the first excited state of $^{27}\mathrm{Mg}$ using the distorted wave Born approximation (DWBA). The charge symmetry properties for mirror nuclei have been used to calculate the ANC for the direct capture $^{26}\mathrm{Si}+p\ensuremath{\rightarrow}\phantom{\rule{0.16em}{0ex}}^{27}\mathrm{P}$ populating the ground state of $^{27}\mathrm{P}$. By means of the same formalism, the ${\mathrm{\ensuremath{\Gamma}}}_{p}$ width for the first excited state has also been deduced. The reaction rate is also updated using recent values for the ${\mathrm{\ensuremath{\Gamma}}}_{\ensuremath{\gamma}}/{\mathrm{\ensuremath{\Gamma}}}_{p}$ ratio measured by [Sun et al., Phys. Rev. C 99, 064312 (2019); Sun et al., Phys. Lett. B 802, 135213 (2020)].