So let me get this straight. If you disconnect the 100Ω resistor between C and D (in post #28) to isolate the phototransistor from the MOSFET's gate, you get voltage at C, which is high when the phototransistor is dark, and low when the phototransistor is lit by the LED?
And when you connect the resistor back to the gate, that voltage is always zero?
If so, it sounds like your MOSFET is damaged. MOSFETs can be damaged quite easily by electrostatic discharge from handling. When you buy them, they should come in anti-static tubing or foam.
You can protect your MOSFET from being damaged by connecting a zener diode permanently between the gate (left pin) and the source (right pin). Do this as soon as you get it home, before you remove the foam. Like this:
