Catalyzes the ligation of 4-hydroxybenzoate, benzoate or cyclohex-1,4-dienecarboxylate and CoA at the expense of ATP. The enzyme shows low activity towards cyclo-2,5-dienecarboxylate, 4-fluorobenzoate, 4-chlorobenzoate and 2-methoxybenzoate. 4-hydroxybenzoate + ATP + CoA = 4-hydroxybenzoyl-CoA + AMP + diphosphate ATP + benzoate + CoA = AMP + benzoyl-CoA + diphosphate Optimum pH is above 9. Homodimer. The N-terminus is blocked. Belongs to the ATP-dependent AMP-binding enzyme family. Benzoate-CoA ligase subfamily.