phpapache port weirdness

Wed, Jan 21, 2009

Had a bit of a head scratcher today. Adding the notification plugin to my dev Elgg, once you posted the change form, it came up with a connection error. Turns out PHP wasn’t picking up the correct port, 8091 and was always reporting SERVER_PORT = 80. Had a trawl through the apache conf, no port 80 specified. Where was it getting it from? Then I remembered the virtual host file:

NameVirtualHost *:8091
<VirtualHost *:8091>
  ServerName sgarbh.smo.uhi.ac.uk
  …
turns out I have to do this to get the port working in PHP:
ServerName sgarbh.smo.uhi.ac.uk:8091

comments powered by Disqus