Sometimes you might encounter an unexpected “CLI has stopped working” while running php in cli mode on windows 7. One of the possible causes is the fact that you’re running without administrator privileges. For example, taking the following symfony statement “php symfony doctrine:build-schema” in a cmd.exe without administrator privileges, might end up with the aforementioned error. To avoid that, click start and write “cmd” in the bottom search box > cmd.exe will appear > right click it and click Run as administrator. The error should not show up anymore.