How to run scratch file with local interpreter ?
已回答
Hey,
I have the vagrant setup and my project uses the remote interpreter.
I just created a scratch file and tried to run it. I realized that PhpStorm tries to run it trough the remote interpreter.
Is there any way to run scratch file via local interpreter?
Even If I have a chance to change the default path of scratches I can point it to my shared folder.
Thanks
请先登录再写评论。
> Is there any way to run scratch file via local interpreter?
You would need to setup (download & install PHP locally) a local interpreter (not bundled with installation).
I'm having (maybe) the same issue.
For me it is not about installing it, but about automatically recognizing / configuring PhpStorm to use the local interpreter for scratch files, as opposed to the remote interpreter for all other things.
I know that I can manually change it and run it but this is cumbersome.
So far I could not find anything in the run configuration or the php interpreter settings, so I am afraid this is not possible at the moment.
Can you confirm this?
Thanks.
Hey Dmitry, I already have the local interpreter. I can run my file in terminal. I'm looking for ability to run scratch with `Run` command of PhpStorm. I don't want to go to terminal and run it
This would require having two default interpreters - a local one and a remote one.
I really doubt we are going to implement this, but if you feel like it's crucial, please submit a feature request: https://youtrack.jetbrains.com/newIssue?project=WI
Thanks for the clarification, Eugene.
@Mustafa: What I am doing when running scratch files, is quickly opening the settings via the shortcut, go to the PHP configurations, and switch from my remote interpreter to the local interpreter. When I am done, I do the same and switch back to the remote interpreter. Not nice, but maybe a little bit easier then using the terminal.
You may also create External Tools entry and assign any shortcut to it -- it's not the same as Run/Debug button for sure .. but might be enough/better that switching PHP Interpreters all the time.
whoever gets to this post now:
you can configure a local interpreter to your scratch files using the 'Run/Debug Configurations` menu.
this will let you run the scratch files with a specific interpreter while preserving the project default one.