Member of the two-component regulatory system PhoP/PhoQ which regulates the expression of genes involved in virulence and resistance to host defense antimicrobial peptides. In low periplasmic Mg(2+), PhoQ functions as a membrane-associated protein kinase that undergoes autophosphorylation and subsequently transfers the phosphate to PhoP, which results in the expression of PhoP-activated genes (PAG) and repression of PhoP-repressed genes (PRG). In high periplasmic Mg(2+), acts as a protein phosphatase that dephosphorylates phospho-PhoP, which results in the repression of PAG and may lead to expression of some PRG (By similarity). Promotes intramacrophage survival of S.typhi. Is required to enhance bacterial resistance to bile in the human intestinal cells. ATP + protein L-histidine = ADP + protein N-phospho-L-histidine. Homodimer.