We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon in phpstorm

Hello, friends! I'm a new user of phalcon and I can't integrate it with phalcon. When I type 'phalcon' in phpstorm console I see this error: "Cannot run program "phalcon" (in directory "C:\wamp\www\blog"): CreateProcess error=2, Can not find the file specified" I use windows 7. In cmd all ok. How to fix this?

Tganks.

P.S.: part error "..Can not find the file specified" have a rough translation with Google Translate



98.9k

You need to add phalcon.bat in developer tools to your environment variable PATH. Follow the installation instructions available on https://docs.phalcon.io/en/latest/reference/wintools.html



4.9k

C:\wamp\phalcon-devtools\ide\phpstorm or C:\wamp\phalcon-devtools\?



10

i get the same error from Phpstorm 6 :( "Cannot run program "phalcon" (in directory "D:\Codes\PHP\root\phalcon\forum"): CreateProcess error=2, The system cannot find the file specified" Phalcon-tools path : C:\phalcon-tools Project path : D:\Codes\PHP\root\phalcon\forum Environment Variables PATH follow the installation instructions ==> OK Run in Cmd is OK

i use Win 7, php 5.4.16, Phpstorm 6, Phalcon 1.2.0



2.9k

Hi,

if you can run it with cmd but not with phpstorm, that's because you didn't specify the correct path in phpstorm, to do so :

  • Open settings in phpstorm
  • go in "Command line Tool support"
  • click on the green "+" A new windows opens, click on visibility -> "global" (if you don't want to do that for every phalcon projects). The select is by default on Custom tool.

When you clicked OK, you'll have 3 inputs ; the path (for the .bat file in your C:\phalcon-tools). You fill the others input like you want, for instance you can put "phalcon" for alias.

If i'm not mistaken, you'll have the new entry in the list, press Apply and then OK. After that you can write phalcon commands in the command line tools console of phpstorm. If it says something like "access refused", you'll have to either move the folder phalcon-tools into another directory where you'll have access OR change the rights on the directory.

I hope i've been useful :)



4.0k

Thank you for your feedback. Had the same issue.

My solution: After adding in phpstorm the alias phalcon and the path to the .bat file (e.g.: E:\xampp\htdocs\phalcon-dev\ide\phpstorm\phalcon.bat), I had to change the content of the phalcon.bat More precisely I had to change the "set PTOOLSPATH=." to -> "set PTOOLSPATH=E:\xampp\htdocs\phalcon-dev"

OS: windows8 local server: xampp (php 5.4.x)

Now it works.

Had about the same problem and found this solution. for who installed Phalcon dev tools as a Composer dependecy (as documentation suggest) on Windows (i'm on Win7), the solution to make the commandline tool work in phpStorm is to edit sh [your-project-path]\vendor\phalcon-dev\ide\phpstorm\phalcon.bat and replace sh set PTOOLSPATH=.

with

sh set PTOOLSPATH=.\vendor\phalcon\devtools

On my machine (Win7) the cmd line was giving this error "Could not open input file: .\phalcon.php" and now it works great. I discovered the problem was the current path of execution. I tought it was executing the .bat file from its directory... instead it execute the .bat from the project root folder...

My 2 cents.



165

I suggest to use Codelobster for Phalcon It has very good autocomplete for this framework.