I've seen a similar question somewhere; it was recommended to do all deactivations first, then all activations, in case some modules are dependent on others. So change your script to:
port deactivate php5 @5.3.0_2+apache2+macosx+mysql5+pear+postgresql83 port deactivate php5-syck @0.55_2 port deactivate php5-memcache @2.2.5_1 port deactivate php5-xdebug @2.0.5_0 port activate php5 @5.2.9_2+apache2+macosx+mysql5+pear+postgresql83 port activate php5-syck @0.55_1 port activate php5-memcache @2.2.5_0 port activate php5-xdebug @2.0.4_0 /opt/local/apache2/bin/apachectl restart