3

Stuck at Error: "Symfony console must be selected"

I've been trying for almost a week to set up an environment to develope a web application using Symfony2 framework and NetBeans IDE. I already have a an HTML-Bootstrap-Javascript project ready. There is no engine to the car yet, except for a few trial use cases. The requirement is to select an approriate framework and IDE to develop the php part of the application.

I've done the following:

  • Installed the installer from command line and moved to the projects folder (which is in the wamp/www directory)
  • Created new symfony project from command line ( php symfony new Test)
  • Downloaded and installed NetBeans 8.1 (I've tried 8.0.1 as well, thinking that using the .zip file from GitHub might solve the problem as most solutions online to similar issues are related to using the .zip folde - 8.1 takes installer path)
  • In NetBeans tools/options I've given path to php.exe and under frameworks "Installer" selected the installer file I had downloaded (D:\wamp\www\projects\symfony). One thing that bugs me here is that if I click "Search.." after selecting this path, it doesnt find the installer.

After creating new project, and going through all the steps of the wizard (selecting framework symphony2) I get the error "symfony2 console must be selected" At this point the options dialog box comes to foreground with the "frameworks & tools" tab open.Option dialog box when pops up when error dialog box is closed

Since I'm not using any zip file, instead I'm using the installer, I cannot apply the recommendations on another post here which talks about extracting the zip folder and creating a new zip folder with the sub contents.

Getting frustrated with this combo now, btw...I have tried an older version of NetBeans so I could use the .zip folder from GitHub, implemented the solution I found on stackoverflow....same result. I can really use some help here!! Thanks in advance.

  • Have you tried 'create a new project with existing sources'? – user2182349 Jan 02 '16 at 00:24
  • @user2182349 Yes, when I use 8.1 NetBeans, it doesn't give the "symfony2 console must be selected error", but it gives "contains files with errors" Error through out the path: project/source files/vendor/ symfony/symfony/src/Symfony/Component.....it indicates error in 6 different folders inside Component – suspicious_coder Jan 02 '16 at 03:47

2 Answers2

2

In Netbeans: Project Properties, Ignored Folders, include the project's vendor folder. Any errors Netbeans finds there can be ignored.

Also, in project properties, select Frameworks, Symfony2. Check "Enabled" and "Ignore app/cache Directory". With Symfony already installed, you do not need an entry in Netbean's Tools, Options, PHP, Frameworks..., Symfony2 Installer. Be sure that "Ignore cache Directory by Default" is checked.

geoB
  • 4,578
  • 5
  • 37
  • 70
  • Thanks for the response. In project properties - Frameworks - Symfony2...what should be the "App Directory"?....I have selected app folder from the project but get "Console script not found underneath App directory" warning at the bottom with the OK button disabled – suspicious_coder Jan 02 '16 at 18:44
  • Curious. A standard Symfony installation includes a PHP file `console` (no php extension) under the `.../app` folder. The expected value for "App Directory" is simply "app". Do you have a `console` file anywhere? – geoB Jan 02 '16 at 18:53
  • 1
    Yes...its under bin, and using bin folder instead of App worked. Thanks a bunch. – suspicious_coder Jan 02 '16 at 18:58
  • Makes sense. I'm still back in the `.../app` folder installations. Symfony has since moved to `.../bin`. Glad it's worked out for you. – geoB Jan 02 '16 at 19:14
1

Here is my solution:

  1. This solution was tested using Windows XP, Xampp, NetBeans 8.1 and symfony 2.8.
  2. Download Symfony 2.8 as explained in the Symfony official site.
  3. Download it into a folder named "C:\my_project" (but my destination folder, will be: "C:\projects\my_project") Then I compressed this folder (for example, by using Winzip).

  4. Open NetBeans 8.1. First of all, I select "Tools|Options|PHP and put in the PHP 5 Interpeter: "C:\xampp\php\php.exe" and click "OK"

  5. Select : "File | Import project ... | From the ZIP file" I select the ZIP file "my_project.zip", and the "Folder: C:\projects" and proceed to import the project

  6. When importing is finished, select: "File | Close All Projects"

  7. Then "File | Open project ..." and select the new project

  8. Finally, select "File | Project Properties" and in the "Sources" option make sure that the path: "Project folder" and "Source folder" are the same. In my case: "C:\projects\my_project"

Jorge H
  • 306
  • 1
  • 4
  • 19
  • A Spanish version of my answer, and with illustrative images , can be found at: http://symfonyandme.com/2016/03/25/utilizar-symfony-2-8-con-netbeans-8-1/ – Jorge H Mar 25 '16 at 22:28