Turn on MOSFet with Optotransistor
Remove R1 (replace it with a short) and it'll work fine with an optotransistor in place of Q1.

It will not work with a regular transistor, however, since Q1 is wired as an emitter follower and won't deliver the full gate voltage. (It will only deliver the input voltage, minus a diode drop, to the gate.)