Solenoid switched by optocoupler?

Tried everything must be wiring, only put it in at the wkend and not really had chance to check it properly yet been too busy with decorating and bike repairs. Imagine life getting in the way of hobbies, I really must get my priorities right!