When the photo transistor detects the emitter light, the voltage at the emitter of photo transistor is 11.5V. But at the collector of pnp it is 12V. How is like this, since high voltage is at the base of pnp it should not work know?
There's high and then there's not high enough. The pnp transistor Vbe will be about 0.7V hence 11.5 is just enough to keep the pnp transistor on and it's collector at 12V. I would check you have enough light on the transistor to switch the npn hard on. What do you get if the LED is off?
Your resistor R2 4700 ohms is a too low value..multiply by 10 or more...
so R2 > 47K or 100K
depend of phototransistor transfert value and light power .
you can check before , without connecting Q1 !
what appends ?